ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkFastChamferDistanceImageFilter.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 itkFastChamferDistanceImageFilter_h
19 #define itkFastChamferDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkNarrowBand.h"
24 
25 namespace itk
26 {
54 template< typename TInputImage, typename TOutputImage >
55 class ITK_TEMPLATE_EXPORT FastChamferDistanceImageFilter:
56  public ImageToImageFilter< TInputImage, TOutputImage >
57 {
58 public:
64 
66  itkNewMacro(Self);
67 
70 
72  typedef TInputImage InputImageType;
73 
75  typedef TOutputImage OutputImageType;
76 
78  typedef typename InputImageType::RegionType RegionType;
79 
81  typedef typename InputImageType::PixelType PixelType;
82 
84  typedef typename RegionType::IndexType IndexType;
85 
87  typedef typename InputImageType::OffsetType OffsetType;
88 
90  typedef typename RegionType::SizeType SizeType;
91 
93  itkStaticConstMacro(ImageDimension, unsigned int,
94  InputImageType::ImageDimension);
95  itkStaticConstMacro(OutputImageDimension, unsigned int,
96  OutputImageType::ImageDimension);
98 
100  typedef typename InputImageType::ConstPointer InputImagePointer;
101 
106 
108 
110  itkSetMacro(Weights, WeightsType);
111  itkGetConstReferenceMacro(Weights, WeightsType);
113 
115  itkSetMacro(MaximumDistance, float);
116  itkGetConstMacro(MaximumDistance, float);
118 
120  void SetRegionToProcess(const RegionType & r);
121 
122  RegionType GetRegionToProcess() const;
123 
124  void SetNarrowBand(NarrowBandType *ptr);
125 
126  NarrowBandPointer GetNarrowBand() const;
127 
128 #ifdef ITK_USE_CONCEPT_CHECKING
129  // Begin concept checking
130  itkConceptMacro( SameDimensionCheck,
132  itkConceptMacro( SameTypeCheck,
134  itkConceptMacro( FloatConvertibleToPixelTypeCheck,
136  itkConceptMacro( PixelTypeConvertibleToFloatCheck,
138  itkConceptMacro( PixelTypeGreaterThanFloatCheck,
140  itkConceptMacro( PixelTypeLessThanFloatCheck,
142  itkConceptMacro( PixelTypeFloatAdditiveOperatorsCheck,
144  itkConceptMacro( FloatGreaterThanPixelTypeCheck,
146  itkConceptMacro( FloatLessThanPixelTypeCheck,
148  // End concept checking
149 #endif
150 
151 protected:
153  virtual ~FastChamferDistanceImageFilter() ITK_OVERRIDE {}
154  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
155 
158  void GenerateDataND();
159 
162  void GenerateData() ITK_OVERRIDE;
163 
164 private:
165  ITK_DISALLOW_COPY_AND_ASSIGN(FastChamferDistanceImageFilter);
166 
167  float m_MaximumDistance;
168 
170  WeightsType m_Weights;
171 
172  NarrowBandPointer m_NarrowBand;
173 
175  RegionType m_RegionToProcess;
176 }; // end of FastChamferDistanceImageFilter class
177 } //end namespace itk
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkFastChamferDistanceImageFilter.hxx"
181 #endif
182 
183 #endif
Base class for all process objects that output image data.
This class compute the signed (positive and negative) chamfer distance in a narrow band...
Narrow Band class.
Definition: itkNarrowBand.h:51
FixedArray< float, ImageDimension > WeightsType
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
#define itkConceptMacro(name, concept)
ImageToImageFilter< TInputImage, TOutputImage > Superclass