ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkKappaSigmaThresholdImageFilter.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 __itkKappaSigmaThresholdImageFilter_h
19 #define __itkKappaSigmaThresholdImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
50 template< class TInputImage,
51  class TMaskImage = Image< unsigned char, TInputImage::ImageDimension >,
52  class TOutputImage = TInputImage >
54  public ImageToImageFilter< TInputImage, TOutputImage >
55 {
56 public:
62 
64  itkNewMacro(Self);
65 
68 
70  typedef TInputImage InputImageType;
71  typedef TMaskImage MaskImageType;
72 
74  typedef typename TInputImage::PixelType InputPixelType;
75  typedef typename TOutputImage::PixelType OutputPixelType;
76  typedef typename TMaskImage::PixelType MaskPixelType;
77 
79  typedef typename TInputImage::Pointer InputImagePointer;
80  typedef typename TOutputImage::Pointer OutputImagePointer;
81  typedef typename TMaskImage::Pointer MaskImagePointer;
82 
85  itkSetMacro(OutsideValue, OutputPixelType);
86 
88  itkGetConstMacro(OutsideValue, OutputPixelType);
89 
92  itkSetMacro(InsideValue, OutputPixelType);
93 
95  itkGetConstMacro(InsideValue, OutputPixelType);
96 
98  itkGetConstMacro(Threshold, InputPixelType);
99 
100  itkSetMacro(MaskValue, MaskPixelType);
101  itkGetConstMacro(MaskValue, MaskPixelType);
102 
103  itkSetMacro(SigmaFactor, double);
104  itkGetConstMacro(SigmaFactor, double);
105 
106  itkSetMacro(NumberOfIterations, unsigned int);
107  itkGetConstMacro(NumberOfIterations, unsigned int);
108 
109 #ifdef ITK_USE_CONCEPT_CHECKING
110 
111  itkConceptMacro( OutputComparableCheck,
113  itkConceptMacro( OutputOStreamWritableCheck,
115 
117 #endif
118 
120  void SetMaskImage(const MaskImageType *input)
121  {
122  // Process object is not const-correct so the const casting is required.
123  this->SetNthInput( 1, const_cast< MaskImageType * >( input ) );
124  }
125 
127  const MaskImageType * GetMaskImage() const
128  {
129  return static_cast< MaskImageType * >( const_cast< DataObject * >( this->ProcessObject::GetInput(1) ) );
130  }
131 
133  void SetInput1(const TInputImage *input)
134  {
135  this->SetInput(input);
136  }
137 
139  void SetInput2(const MaskImageType *input)
140  {
141  this->SetMaskImage(input);
142  }
143 
144 protected:
147  void PrintSelf(std::ostream & os, Indent indent) const;
148 
149  void GenerateInputRequestedRegion();
150 
151  void GenerateData();
152 
153  typedef typename TInputImage::SizeType InputSizeType;
154  typedef typename TInputImage::IndexType InputIndexType;
155  typedef typename TInputImage::RegionType InputImageRegionType;
156  typedef typename TOutputImage::SizeType OutputSizeType;
157  typedef typename TOutputImage::IndexType OutputIndexType;
158  typedef typename TOutputImage::RegionType OutputImageRegionType;
159 
161 
163  itkStaticConstMacro(InputImageDimension, unsigned int,
164  TInputImage::ImageDimension);
165  itkStaticConstMacro(OutputImageDimension, unsigned int,
166  TOutputImage::ImageDimension);
168 
169 private:
170  KappaSigmaThresholdImageFilter(const Self &); //purposely not implemented
171  void operator=(const Self &); //purposely not implemented
172 
175  unsigned int m_NumberOfIterations;
179 }; // end of class
180 } // end namespace itk
181 
182 #ifndef ITK_MANUAL_INSTANTIATION
183 #include "itkKappaSigmaThresholdImageFilter.hxx"
184 #endif
185 
186 #endif
187