ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkParabolicOpenCloseImageFilter.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 itkParabolicOpenCloseImageFilter_h
19 #define itkParabolicOpenCloseImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkProgressReporter.h"
24 
25 namespace itk
26 {
52 template< typename TInputImage,
53  bool doOpen,
54  typename TOutputImage = TInputImage >
56  public ImageToImageFilter< TInputImage, TOutputImage >
57 {
58 public:
59 
65 
67  itkNewMacro(Self);
68 
71 
73  typedef TInputImage InputImageType;
74  typedef TOutputImage OutputImageType;
75  typedef typename TInputImage::PixelType PixelType;
78  typedef typename TOutputImage::PixelType OutputPixelType;
79  typedef typename OutputImageType::RegionType OutputImageRegionType;
80  typedef typename TInputImage::SizeType InputSizeType;
81  typedef typename TOutputImage::SizeType OutputSizeType;
82 
84  typedef typename TInputImage::Pointer InputImagePointer;
85  typedef typename TInputImage::ConstPointer InputImageConstPointer;
86 
87  typedef typename OutputImageType::IndexType OutputIndexType;
88 
90  itkStaticConstMacro(OutputImageDimension, unsigned int,
91  TOutputImage::ImageDimension);
92  itkStaticConstMacro(InputImageDimension, unsigned int,
93  TInputImage::ImageDimension);
94  itkStaticConstMacro(ImageDimension, unsigned int,
95  TInputImage::ImageDimension);
97 
100 
106  //typedef typename Image<InternalRealType,
107  // itkGetStaticConstMacro(ImageDimension) > RealImageType;
108 
109  // set all of the scales the same
110  void SetScale(ScalarRealType scale);
111 
112  itkSetMacro(Scale, RadiusType);
113  itkGetConstReferenceMacro(Scale, RadiusType);
118  itkSetMacro(UseImageSpacing, bool);
119  itkGetConstReferenceMacro(UseImageSpacing, bool);
120  itkBooleanMacro(UseImageSpacing);
122 
124  NOCHOICE = 0, // decices based on scale - experimental
125  CONTACTPOINT = 1, // sometimes faster at low scale
126  INTERSECTION = 2 // default
127  };
134  itkSetMacro(ParabolicAlgorithm, int);
135  itkGetConstReferenceMacro(ParabolicAlgorithm, int);
136 
137 #ifdef ITK_USE_CONCEPT_CHECKING
138 
139  itkConceptMacro( SameDimension,
140  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
141  itkGetStaticConstMacro(OutputImageDimension) > ) );
142 
143  itkConceptMacro( Comparable,
145 
147 #endif
148 protected:
151  void PrintSelf(std::ostream & os, Indent indent) const;
153 
155  void GenerateData(void);
156 
157  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
158  OutputImageRegionType & splitRegion);
159 
160  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
161 
162  virtual void GenerateInputRequestedRegion() throw( InvalidRequestedRegionError );
163 
164  // Override since the filter produces the entire dataset.
165  void EnlargeOutputRequestedRegion(DataObject *output);
166 
167  int m_ParabolicAlgorithm;
168 private:
169  ParabolicOpenCloseImageFilter(const Self &); //purposely not implemented
170  void operator=(const Self &); //purposely not implemented
171 
172  RadiusType m_Scale;
173 
174  typename TInputImage::PixelType m_Extreme;
175  typename TInputImage::PixelType m_Extreme1;
176  typename TInputImage::PixelType m_Extreme2;
177 
178  int m_MagnitudeSign;
179  int m_MagnitudeSign1;
180  int m_MagnitudeSign2;
181  int m_CurrentDimension;
182  int m_Stage;
183  bool m_UseImageSpacing;
184 };
185 } // end namespace itk
186 
187 #ifndef ITK_MANUAL_INSTANTIATION
188 #include "itkParabolicOpenCloseImageFilter.hxx"
189 #endif
190 
191 #endif
NumericTraits< PixelType >::ScalarRealType ScalarRealType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Base class for all process objects that output image data.
NumericTraits< PixelType >::FloatType InternalRealType
NumericTraits< PixelType >::RealType RealType
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
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)
Parent class for morphological opening and closing operations with parabolic structuring elements...
Base class for all data objects in ITK.
itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType