Evita  0.16
evSegmentationMap.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evSegmentationMap_h
25 #define __evSegmentationMap_h
26 
27 
28 #include "evField.h"
29 #include "evBitBuffer.h"
30 
31 
33 
34 
36 {
37 public:
38  evSegmentationMap(void);
39  virtual ~evSegmentationMap(void);
40 
41  virtual const evString GetClassName(void) const
42  {
43  return(evString("evSegmentationMap"));
44  }
45 
46  void Free(void);
47 
48  int GetMaxROINumber(void) const;
49  void SetMaxROINumber(void);
50 
51  int GetFieldMax(void) const;
52  int GetFieldMin(void) const;
53 
54  int Copy(const evSegmentationMap &segmentation_map);
55  // int Copy(const evField<int> &field);
56 
57  int Read(const evString filename);
58  int Read(evBitBuffer &input_buffer);
59  int Write(const evString filename) const;
60  int Write(evBitBuffer &output_buffer) const;
61 
62  int SetCodec(const evString compression_method);
63  evSegmentationMapCodec *GetCodec(void) const;
64 
65  int FindBoundingBox(const int roi_num,
66  evAddress &max_coordinates,
67  evAddress &min_coordinates) const;
68 
69 protected:
70 
71 private:
74 
75  void Initialize(void);
76  int ReadHeader(evFile &infile, evString &compression_method);
77  int WriteHeader(evFile &outfile) const;
78 };
79 
80 
81 inline int evSegmentationMap::GetMaxROINumber(void) const
82 {
83  return(this->MaxROINumber);
84 }
85 
86 
88 {
89  this->MaxROINumber = this->GetFieldMax();
90 }
91 
92 
93 inline int evSegmentationMap::GetFieldMax(void) const
94 {
95  return(*std::max_element(this->Field.begin(),
96  this->Field.end()));
97 }
98 
99 
100 inline int evSegmentationMap::GetFieldMin(void) const
101 {
102  return(*std::min_element(this->Field.begin(),
103  this->Field.end()));
104 }
105 
106 
107 #endif
virtual const evString GetClassName(void) const
Definition: evSegmentationMap.h:41
Definition: evFile.h:44
int GetFieldMax(void) const
Definition: evSegmentationMap.h:93
int ReadHeader(evFile &infile, evString &compression_method)
virtual ~evSegmentationMap(void)
int Copy(const evSegmentationMap &segmentation_map)
void SetMaxROINumber(void)
Definition: evSegmentationMap.h:87
evSegmentationMapCodec * GetCodec(void) const
Definition: evAddress.h:37
int MaxROINumber
Definition: evSegmentationMap.h:72
evSegmentationMapCodec * Codec
Definition: evSegmentationMap.h:73
int Read(const evString filename)
int GetFieldMin(void) const
Definition: evSegmentationMap.h:100
std::vector< int > Field
Definition: evField.h:125
Definition: evBitBuffer.h:34
int GetMaxROINumber(void) const
Definition: evSegmentationMap.h:81
void Initialize(void)
int Write(const evString filename) const
int WriteHeader(evFile &outfile) const
int SetCodec(const evString compression_method)
Definition: evSegmentationMap.h:35
Definition: evSegmentationMapCodec.h:33
Definition: evString.h:30
int FindBoundingBox(const int roi_num, evAddress &max_coordinates, evAddress &min_coordinates) const