ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkBinaryReconstructionByErosionImageFilter.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 __itkBinaryReconstructionByErosionImageFilter_h
19 #define __itkBinaryReconstructionByErosionImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkLabelMap.h"
29 
30 
31 namespace itk {
32 
54 template<class TInputImage>
56  public ImageToImageFilter<TInputImage, TInputImage>
57 {
58 public:
64 
66  typedef TInputImage InputImageType;
67  typedef TInputImage OutputImageType;
68  typedef typename InputImageType::Pointer InputImagePointer;
69  typedef typename InputImageType::ConstPointer InputImageConstPointer;
70  typedef typename InputImageType::RegionType InputImageRegionType;
71  typedef typename InputImageType::PixelType InputImagePixelType;
72  typedef typename OutputImageType::Pointer OutputImagePointer;
73  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
74  typedef typename OutputImageType::RegionType OutputImageRegionType;
75  typedef typename OutputImageType::PixelType OutputImagePixelType;
76 
78  itkStaticConstMacro(InputImageDimension, unsigned int,
79  TInputImage::ImageDimension);
80  itkStaticConstMacro(OutputImageDimension, unsigned int,
81  TInputImage::ImageDimension);
82  itkStaticConstMacro(ImageDimension, unsigned int,
83  TInputImage::ImageDimension);
85 
93 
95  itkNewMacro(Self);
96 
99 
106  itkSetMacro(FullyConnected, bool);
107  itkGetConstReferenceMacro(FullyConnected, bool);
108  itkBooleanMacro(FullyConnected);
110 
111 #ifdef ITK_USE_CONCEPT_CHECKING
112 
113  itkConceptMacro(InputEqualityComparableCheck,
115  itkConceptMacro(IntConvertibleToInputCheck,
117  itkConceptMacro(InputOStreamWritableCheck,
119 
121 #endif
122 
127  itkSetMacro(BackgroundValue, OutputImagePixelType);
128  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
130 
135  itkSetMacro(ForegroundValue, OutputImagePixelType);
136  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
138 
140  void SetMarkerImage(InputImageType *input)
141  {
142  // Process object is not const-correct so the const casting is required.
143  this->SetNthInput( 0, const_cast<InputImageType *>(input) );
144  }
145 
147  InputImageType * GetMarkerImage()
148  {
149  return static_cast<InputImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(0)));
150  }
151 
153  void SetMaskImage(const InputImageType *input)
154  {
155  // Process object is not const-correct so the const casting is required.
156  this->SetNthInput( 1, const_cast<InputImageType *>(input) );
157  }
158 
160  InputImageType * GetMaskImage()
161  {
162  return static_cast<InputImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
163  }
164 
165 protected:
168  void PrintSelf(std::ostream& os, Indent indent) const;
169 
173  void GenerateInputRequestedRegion();
174 
176  void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
177 
180  void GenerateData();
181 
182 private:
183  BinaryReconstructionByErosionImageFilter(const Self&); //purposely not implemented
184  void operator=(const Self&); //purposely not implemented
185 
189 }; // end of class
190 
191 } // end namespace itk
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkBinaryReconstructionByErosionImageFilter.hxx"
195 #endif
196 
197 #endif
198