ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkDanielssonDistanceMapImageFilter.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 __itkDanielssonDistanceMapImageFilter_h
19 #define __itkDanielssonDistanceMapImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
58 template< typename TInputImage,
59  typename TOutputImage,
60  typename TVoronoiImage = TInputImage >
62  public ImageToImageFilter< TInputImage, TOutputImage >
63 {
64 public:
70 
72 
74  itkNewMacro(Self);
75 
78 
80  typedef TInputImage InputImageType;
81 
83  typedef typename InputImageType::PixelType InputPixelType;
84 
86  typedef typename InputImageType::RegionType RegionType;
87 
89  typedef typename RegionType::IndexType IndexType;
90 
92  typedef typename InputImageType::OffsetType OffsetType;
93 
95  typedef typename InputImageType::SpacingType SpacingType;
96  typedef typename InputImageType::SpacingValueType SpacingValueType;
97 
99  typedef typename RegionType::SizeType SizeType;
100 
103 
106  typedef TOutputImage OutputImageType;
107 
109  typedef typename OutputImageType::PixelType OutputPixelType;
110 
111  typedef TVoronoiImage VoronoiImageType;
112  typedef typename VoronoiImageType::Pointer VoronoiImagePointer;
113  typedef typename VoronoiImageType::PixelType VoronoiPixelType;
114 
116  itkStaticConstMacro(InputImageDimension, unsigned int,
117  InputImageType::ImageDimension);
118 
120  typedef Image< OffsetType,
121  itkGetStaticConstMacro(InputImageDimension) > VectorImageType;
122 
124  typedef typename InputImageType::ConstPointer InputImagePointer;
125 
127  typedef typename OutputImageType::Pointer OutputImagePointer;
128 
131 
133  itkSetMacro(SquaredDistance, bool);
134 
136  itkGetConstReferenceMacro(SquaredDistance, bool);
137 
139  itkBooleanMacro(SquaredDistance);
140 
146  itkSetMacro(InputIsBinary, bool);
147 
149  itkGetConstReferenceMacro(InputIsBinary, bool);
150 
152  itkBooleanMacro(InputIsBinary);
153 
155  itkSetMacro(UseImageSpacing, bool);
156 
158  itkGetConstReferenceMacro(UseImageSpacing, bool);
159 
161  itkBooleanMacro(UseImageSpacing);
162 
169 
179 
182 
187 
188 #ifdef ITK_USE_CONCEPT_CHECKING
189  itkStaticConstMacro(OutputImageDimension, unsigned int,
190  TOutputImage::ImageDimension);
191  itkStaticConstMacro(VoronoiImageDimension, unsigned int,
192  TVoronoiImage::ImageDimension);
193 
194  // Begin concept checking
195  itkConceptMacro( InputOutputSameDimensionCheck,
197  itkConceptMacro( InputVoronoiSameDimensionCheck,
199  itkConceptMacro( DoubleConvertibleToOutputCheck,
201  itkConceptMacro( InputConvertibleToOutputCheck,
203  OutputPixelType > ) );
204  // End concept checking
205 #endif
206 
207 protected:
210  void PrintSelf(std::ostream & os, Indent indent) const;
211 
213  void GenerateData();
214 
216  void PrepareData();
217 
219  void ComputeVoronoiMap();
220 
223  const IndexType &,
224  const OffsetType &);
225 
226 private:
227  DanielssonDistanceMapImageFilter(const Self &); //purposely not implemented
228  void operator=(const Self &); //purposely not implemented
229 
233 
235 
236 }; // end of DanielssonDistanceMapImageFilter class
237 } //end namespace itk
238 
239 #ifndef ITK_MANUAL_INSTANTIATION
240 #include "itkDanielssonDistanceMapImageFilter.hxx"
241 #endif
242 
243 #endif
OutputImageType * GetDistanceMap(void)
Light weight base class for most itk classes.
virtual ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) ITK_OVERRIDE
unsigned long SizeValueType
Definition: itkIntTypes.h:143
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
void UpdateLocalDistance(VectorImageType *, const IndexType &, const OffsetType &)
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
void PrintSelf(std::ostream &os, Indent indent) const
Base class for filters that take an image as input and produce an image as output.
VoronoiImageType * GetVoronoiMap(void)
ImageToImageFilter< TInputImage, TOutputImage > Superclass
VectorImageType * GetVectorDistanceMap(void)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Image< OffsetType, itkGetStaticConstMacro(InputImageDimension) > VectorImageType
This filter computes the distance map of the input image as an approximation with pixel accuracy to t...
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75