ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkSignedMaurerDistanceMapImageFilter.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 itkSignedMaurerDistanceMapImageFilter_h
19 #define itkSignedMaurerDistanceMapImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
61 template< typename TInputImage, typename TOutputImage >
63  public ImageToImageFilter< TInputImage, TOutputImage >
64 {
65 public:
66 
68  itkStaticConstMacro(InputImageDimension, unsigned int,
69  TInputImage::ImageDimension);
70  itkStaticConstMacro(OutputImageDimension, unsigned int,
71  TOutputImage::ImageDimension);
72  itkStaticConstMacro(ImageDimension, unsigned int,
73  TOutputImage::ImageDimension);
75 
77  typedef TInputImage InputImageType;
78  typedef typename InputImageType::ConstPointer InputImageConstPointer;
79 
80  typedef TOutputImage OutputImageType;
81  typedef typename OutputImageType::Pointer OutputImagePointer;
82 
85  typedef ImageToImageFilter<
88 
91 
93  itkNewMacro(Self);
94 
98 
99  typedef typename InputImageType::RegionType InputRegionType;
100  typedef typename OutputImageType::RegionType OutputRegionType;
101 
103  typedef typename InputImageType::PixelType InputPixelType;
104  typedef typename OutputImageType::PixelType OutputPixelType;
105 
106  typedef typename InputImageType::SizeType InputSizeType;
108  typedef typename OutputImageType::SizeType OutputSizeType;
110 
111  typedef typename InputImageType::IndexType InputIndexType;
113  typedef typename OutputImageType::IndexType OutputIndexType;
115 
116  typedef typename InputImageType::SpacingType InputSpacingType;
117  typedef typename OutputImageType::SpacingType OutputSpacingType;
118  typedef typename OutputImageType::RegionType OutputImageRegionType;
119 
121  itkSetMacro(SquaredDistance, bool);
122 
124  itkGetConstReferenceMacro(SquaredDistance, bool);
125 
127  itkBooleanMacro(SquaredDistance);
128 
131  itkSetMacro(InsideIsPositive, bool);
132 
135  itkGetConstReferenceMacro(InsideIsPositive, bool);
136 
140  itkBooleanMacro(InsideIsPositive);
141 
143  itkSetMacro(UseImageSpacing, bool);
144 
146  itkGetConstReferenceMacro(UseImageSpacing, bool);
147 
149  itkBooleanMacro(UseImageSpacing);
150 
155  itkSetMacro(BackgroundValue, InputPixelType);
156  itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
158 
159 protected:
162 
163  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
164 
165  virtual void GenerateData() ITK_OVERRIDE;
166 
167  virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
168  OutputImageRegionType & splitRegion) ITK_OVERRIDE;
169 
170  virtual void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
171  ThreadIdType threadId) ITK_OVERRIDE;
172 
173 private:
174  SignedMaurerDistanceMapImageFilter(const Self &) ITK_DELETE_FUNCTION;
175  void operator=(const Self &) ITK_DELETE_FUNCTION;
176 
177  void Voronoi(unsigned int, OutputIndexType idx, OutputImageType *output );
178  bool Remove(OutputPixelType, OutputPixelType, OutputPixelType,
179  OutputPixelType, OutputPixelType, OutputPixelType);
180 
183 
184  unsigned int m_CurrentDimension;
185 
189 
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkSignedMaurerDistanceMapImageFilter.hxx"
196 #endif
197 
198 #endif
signed long IndexValueType
Definition: itkIntTypes.h:150
Base class for all process objects that output image data.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) override
This filter calculates the Euclidean distance transform of a binary image in linear time for arbitrar...
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for filters that take an image as input and produce an image as output.
ImageToImageFilter< InputImageType, OutputImageType > Superclass
OutputImageType::RegionType OutputImageRegionType
bool Remove(OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TOutputImage OutputImageType
void Voronoi(unsigned int, OutputIndexType idx, OutputImageType *output)
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void GenerateData() override