ITK  4.4.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< class TInputImage, class 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:
160 
162 
164 
165  void PrintSelf(std::ostream & os, Indent indent) const;
166 
167  void GenerateData();
168 
169  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
170  OutputImageRegionType & splitRegion);
171 
172  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
173  ThreadIdType threadId);
174 
175 private:
176 
177  SignedMaurerDistanceMapImageFilter(const Self &); //purposely not implemented
178  void operator=(const Self &); //purposely not implemented
179 
180  void Voronoi(unsigned int, OutputIndexType idx, OutputImageType *output );
183 
186 
187  unsigned int m_CurrentDimension;
188 
192 
194 };
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 #include "itkSignedMaurerDistanceMapImageFilter.hxx"
199 #endif
200 
201 #endif
202