ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkParabolicErodeDilateImageFilter.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 itkParabolicErodeDilateImageFilter_h
19 #define itkParabolicErodeDilateImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkProgressReporter.h"
24 
25 namespace itk
26 {
82 template< typename TInputImage,
83  bool doDilate,
84  typename TOutputImage = TInputImage >
86  public ImageToImageFilter< TInputImage, TOutputImage >
87 {
88 public:
94 
96  itkNewMacro(Self);
97 
100 
102  typedef TInputImage InputImageType;
103  typedef TOutputImage OutputImageType;
104  typedef typename TInputImage::PixelType PixelType;
107  typedef typename TOutputImage::PixelType OutputPixelType;
108 
110  typedef typename TInputImage::Pointer InputImagePointer;
111  typedef typename TInputImage::ConstPointer InputImageConstPointer;
114 
116 
119 
121  itkStaticConstMacro(ImageDimension, unsigned int,
122  TInputImage::ImageDimension);
123  itkStaticConstMacro(OutputImageDimension, unsigned int,
124  TOutputImage::ImageDimension);
125  itkStaticConstMacro(InputImageDimension, unsigned int,
126  TInputImage::ImageDimension);
128 
129  typedef typename OutputImageType::RegionType OutputImageRegionType;
135  //typedef typename Image<InternalRealType,
136  // itkGetStaticConstMacro(ImageDimension) > RealImageType;
137 
138  // set all of the scales the same
139  void SetScale(ScalarRealType scale);
140 
141  itkSetMacro(Scale, RadiusType);
142  itkGetConstReferenceMacro(Scale, RadiusType);
143 
145  NOCHOICE = 0, // decices based on scale - experimental
146  CONTACTPOINT = 1, // sometimes faster at low scale
147  INTERSECTION = 2 // default
148  };
155  itkSetMacro(ParabolicAlgorithm, int);
156  itkGetConstReferenceMacro(ParabolicAlgorithm, int);
157 
162  itkSetMacro(UseImageSpacing, bool);
163  itkGetConstReferenceMacro(UseImageSpacing, bool);
164  itkBooleanMacro(UseImageSpacing);
165 
168 #ifdef ITK_USE_CONCEPT_CHECKING
169 
170  itkConceptMacro( SameDimension,
171  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
172  itkGetStaticConstMacro(OutputImageDimension) > ) );
173 
174  itkConceptMacro( Comparable,
176 
178 #endif
179 protected:
182  void PrintSelf(std::ostream & os, Indent indent) const;
184 
186  void GenerateData(void);
187 
188  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
189  OutputImageRegionType & splitRegion);
190 
191  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
192 
193  void GenerateInputRequestedRegion() throw( InvalidRequestedRegionError );
194 
195  // Override since the filter produces the entire dataset.
196  void EnlargeOutputRequestedRegion(DataObject *output);
197 
198  bool m_UseImageSpacing;
199  int m_ParabolicAlgorithm;
200 private:
201  ITK_DISALLOW_COPY_AND_ASSIGN(ParabolicErodeDilateImageFilter);
202 
203  RadiusType m_Scale;
204 
205  typename TInputImage::PixelType m_Extreme;
206 
207  int m_MagnitudeSign;
208  int m_CurrentDimension;
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkParabolicErodeDilateImageFilter.hxx"
214 #endif
215 
216 #endif
NumericTraits< PixelType >::ScalarRealType ScalarRealType
Parent class for morphological operations with parabolic structuring elements.
Base class for all process objects that output image data.
NumericTraits< PixelType >::FloatType InternalRealType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.