ITK  4.2.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);
157 protected:
159 
161 
163 
164  void PrintSelf(std::ostream & os, Indent indent) const;
165 
166  void GenerateData();
167 
168  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
169  OutputImageRegionType & splitRegion);
170 
171  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
172  ThreadIdType threadId);
173 
174 private:
175 
176  SignedMaurerDistanceMapImageFilter(const Self &); //purposely not implemented
177  void operator=(const Self &); //purposely not implemented
178 
179  void Voronoi(unsigned int, OutputIndexType );
182 
185 
186  unsigned int m_CurrentDimension;
187 
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkSignedMaurerDistanceMapImageFilter.hxx"
196 #endif
197 
198 #endif
199