ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkVoronoiSegmentationRGBImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkVoronoiSegmentationRGBImageFilter_h
19 #define __itkVoronoiSegmentationRGBImageFilter_h
20 
22 
23 namespace itk
24 {
53 template< typename TInputImage, typename TOutputImage >
55  public VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage >
56 {
57 public:
63 
67 
69  itkNewMacro(Self);
70 
73  typedef typename Superclass::IndexList IndexList;
74  typedef typename Superclass::IndexType IndexType;
76  typedef typename Superclass::PixelType PixelType;
81 
83  void SetMeanPercentError(double x[6]);
84  void SetSTDPercentError(double x[6]);
85  void GetMeanPercentError(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_MeanPercentError[i]; } }
86  void GetSTDPercentError(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_STDPercentError[i]; } }
87  void GetMean(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_Mean[i]; } }
88  void GetSTD(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_STD[i]; } }
89  void SetMean(double x[6]){ for ( int i = 0; i < 6; i++ ) { m_Mean[i] = x[i]; } }
90  void SetSTD(double x[6]){ for ( int i = 0; i < 6; i++ ) { m_STD[i] = x[i]; } }
91  void GetMeanTolerance(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_MeanTolerance[i]; } }
92  void GetSTDTolerance(double x[6]){ for ( int i = 0; i < 6; i++ ) { x[i] = m_STDTolerance[i]; } }
94 
98  itkSetMacro(MaxValueOfRGB, double);
99  itkGetConstMacro(MaxValueOfRGB, double);
101 
104  void SetTestMean(unsigned int t1, unsigned int t2, unsigned int t3)
105  {
106  m_TestMean[0] = t1;
107  m_TestMean[1] = t2;
108  m_TestMean[2] = t3;
109  }
110 
111  void SetTestSTD(unsigned int t1, unsigned int t2, unsigned int t3)
112  {
113  m_TestSTD[0] = t1;
114  m_TestSTD[1] = t2;
115  m_TestSTD[2] = t3;
116  }
117 
118  void GetTestMean(unsigned int x[3])
119  {
120  x[0] = m_TestMean[0]; x[1] = m_TestMean[1]; x[2] = m_TestMean[2];
121  }
122 
123  void GetTestSTD(unsigned int x[3])
124  {
125  x[0] = m_TestSTD[0]; x[1] = m_TestSTD[1]; x[2] = m_TestSTD[2];
126  }
127 
128  void TakeAPrior(const BinaryObjectImage *aprior);
129 
130  using Superclass::SetInput;
131  virtual void SetInput(const InputImageType *input);
132 
133  virtual void SetInput(unsigned int, const InputImageType *image);
134 
136  itkStaticConstMacro(InputImageDimension, unsigned int,
137  TInputImage::ImageDimension);
138  itkStaticConstMacro(OutputImageDimension, unsigned int,
139  TOutputImage::ImageDimension);
141 
142 #ifdef ITK_USE_CONCEPT_CHECKING
143  // Begin concept checking
144  itkConceptMacro( SameDimensionCheck,
146  itkConceptMacro( IntConvertibleToOutputCheck,
148  // End concept checking
149 #endif
150 
151 protected:
154  void PrintSelf(std::ostream & os, Indent indent) const;
155 
156 private:
157  double m_Mean[6];
158  double m_STD[6];
159  double m_MeanTolerance[6];
160  double m_STDTolerance[6];
162  double m_STDPercentError[6];
164  unsigned int m_TestMean[3];
165  unsigned int m_TestSTD[3];
167 
168  virtual bool TestHomogeneity(IndexList & Plist);
169 
170 private:
171  VoronoiSegmentationRGBImageFilter(const Self &); //purposely not implemented
172  void operator=(const Self &); //purposely not implemented
173 };
174 } //end namespace
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkVoronoiSegmentationRGBImageFilter.hxx"
178 #endif
179 
180 #endif
Base class for VoronoiSegmentationImageFilter.
Base class for all process objects that output image data.
void SetTestMean(unsigned int t1, unsigned int t2, unsigned int t3)
virtual void SetInput(const InputImageType *image)
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
void TakeAPrior(const BinaryObjectImage *aprior)
void SetTestSTD(unsigned int t1, unsigned int t2, unsigned int t3)
void PrintSelf(std::ostream &os, Indent indent) const
VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage > Superclass
virtual void SetInput(const InputImageType *input)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
virtual bool TestHomogeneity(IndexList &Plist)
Templated n-dimensional image class.
Definition: itkImage.h:75