ITK  4.12.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 
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  ITK_DISALLOW_COPY_AND_ASSIGN(ParabolicOpenCloseImageFilter);
170 
171  RadiusType m_Scale;
172 
173  typename TInputImage::PixelType m_Extreme;
174  typename TInputImage::PixelType m_Extreme1;
175  typename TInputImage::PixelType m_Extreme2;
176 
177  int m_MagnitudeSign;
178  int m_MagnitudeSign1;
179  int m_MagnitudeSign2;
180  int m_CurrentDimension;
181  int m_Stage;
182  bool m_UseImageSpacing;
183 };
184 } // end namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkParabolicOpenCloseImageFilter.hxx"
188 #endif
189 
190 #endif
NumericTraits< PixelType >::ScalarRealType ScalarRealType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Base class for all process objects that output image data.
SmartPointer< Self > Pointer
NumericTraits< PixelType >::FloatType InternalRealType
NumericTraits< PixelType >::RealType RealType
SmartPointer< const Self > ConstPointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for all data objects in ITK.
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...
itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType