ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkSignedDanielssonDistanceMapImageFilter.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 itkSignedDanielssonDistanceMapImageFilter_h
19 #define itkSignedDanielssonDistanceMapImageFilter_h
20 
22 #include "itkSubtractImageFilter.h"
23 
24 //Simple functor to invert an image for Outside Danielsson distance map
25 namespace itk
26 {
27 namespace Functor
28 {
29 template< typename InputPixelType >
31 {
32 public:
33  InputPixelType operator()(InputPixelType input) const
34  {
35  if ( input )
36  {
38  }
39  else
40  {
42  }
43  }
44 };
45 }
46 }
47 
48 namespace itk
49 {
87 template< typename TInputImage,
88  typename TOutputImage,
89  typename TVoronoiImage = TInputImage >
91  public ImageToImageFilter< TInputImage, TOutputImage >
92 {
93 public:
99 
101  itkNewMacro(Self);
102 
105 
107  typedef TInputImage InputImageType;
108 
111  typedef TOutputImage OutputImageType;
112 
114  typedef typename InputImageType::RegionType RegionType;
115 
117  typedef typename RegionType::IndexType IndexType;
118 
120  typedef typename InputImageType::OffsetType OffsetType;
121 
123  typedef typename InputImageType::PixelType PixelType;
124 
126  typedef typename RegionType::SizeType SizeType;
127 
129  itkStaticConstMacro(InputImageDimension, unsigned int,
130  InputImageType::ImageDimension);
131 
133  typedef Image< OffsetType,
134  itkGetStaticConstMacro(InputImageDimension) > VectorImageType;
135 
137  typedef typename InputImageType::ConstPointer InputImagePointer;
138 
140  typedef typename OutputImageType::Pointer OutputImagePointer;
141 
144 
145  typedef TVoronoiImage VoronoiImageType;
146  typedef typename VoronoiImageType::Pointer VoronoiImagePointer;
147  typedef typename VoronoiImageType::PixelType VoronoiPixelType;
148 
151 
153  itkSetMacro(SquaredDistance, bool);
154 
156  itkGetConstReferenceMacro(SquaredDistance, bool);
157 
159  itkBooleanMacro(SquaredDistance);
160 
162  itkSetMacro(UseImageSpacing, bool);
163 
165  itkGetConstReferenceMacro(UseImageSpacing, bool);
166 
168  itkBooleanMacro(UseImageSpacing);
169 
172  itkSetMacro(InsideIsPositive, bool);
173 
176  itkGetConstReferenceMacro(InsideIsPositive, bool);
177 
181  itkBooleanMacro(InsideIsPositive);
182 
189 
199 
202 
207 
208 #ifdef ITK_USE_CONCEPT_CHECKING
209  // Begin concept checking
210  itkConceptMacro( IntConvertibleToInputCheck,
212  itkConceptMacro( InputHasNumericTraitsCheck,
214  // End concept checking
215 #endif
216 
217 protected:
220  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
221 
223  void GenerateData() ITK_OVERRIDE;
224 
225 private:
226  SignedDanielssonDistanceMapImageFilter(const Self &) ITK_DELETE_FUNCTION;
227  void operator=(const Self &) ITK_DELETE_FUNCTION;
228 
231  bool m_InsideIsPositive; // ON is treated as inside pixels
232 }; // end of SignedDanielssonDistanceMapImageFilter
233  // class
234 } //end namespace itk
235 
236 #ifndef ITK_MANUAL_INSTANTIATION
237 #include "itkSignedDanielssonDistanceMapImageFilter.hxx"
238 #endif
239 
240 #endif
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
virtual ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
Image< OffsetType, itkGetStaticConstMacro(InputImageDimension) > VectorImageType
Base class for all process objects that output image data.
void PrintSelf(std::ostream &os, Indent indent) const override
InputPixelType operator()(InputPixelType input) const
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
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
TOutputImage OutputImageType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75
ImageToImageFilter< TInputImage, TOutputImage > Superclass