ITK  5.0.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:
59  ITK_DISALLOW_COPY_AND_ASSIGN(FastChamferDistanceImageFilter);
60 
66 
68  itkNewMacro(Self);
69 
72 
74  using InputImageType = TInputImage;
75 
77  using OutputImageType = TOutputImage;
78 
81 
83  using PixelType = typename InputImageType::PixelType;
84 
86  using IndexType = typename RegionType::IndexType;
87 
89  using OffsetType = typename InputImageType::OffsetType;
90 
92  using SizeType = typename RegionType::SizeType;
93 
95  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
96  static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
97 
99  using InputImagePointer = typename InputImageType::ConstPointer;
100 
105 
107 
109  itkSetMacro(Weights, WeightsType);
110  itkGetConstReferenceMacro(Weights, WeightsType);
112 
114  itkSetMacro(MaximumDistance, float);
115  itkGetConstMacro(MaximumDistance, float);
117 
119  void SetRegionToProcess(const RegionType & r);
120 
121  RegionType GetRegionToProcess() const;
122 
123  void SetNarrowBand(NarrowBandType *ptr);
124 
125  NarrowBandPointer GetNarrowBand() const;
126 
127 #ifdef ITK_USE_CONCEPT_CHECKING
128  // Begin concept checking
129  itkConceptMacro( SameDimensionCheck,
131  itkConceptMacro( SameTypeCheck,
133  itkConceptMacro( FloatConvertibleToPixelTypeCheck,
135  itkConceptMacro( PixelTypeConvertibleToFloatCheck,
137  itkConceptMacro( PixelTypeGreaterThanFloatCheck,
139  itkConceptMacro( PixelTypeLessThanFloatCheck,
141  itkConceptMacro( PixelTypeFloatAdditiveOperatorsCheck,
143  itkConceptMacro( FloatGreaterThanPixelTypeCheck,
145  itkConceptMacro( FloatLessThanPixelTypeCheck,
147  // End concept checking
148 #endif
149 
150 protected:
152  ~FastChamferDistanceImageFilter() override = default;
153  void PrintSelf(std::ostream & os, Indent indent) const override;
154 
157  void GenerateDataND();
158 
161  void GenerateData() override;
162 
163 private:
165 
168 
170 
173 }; // end of FastChamferDistanceImageFilter class
174 } //end namespace itk
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkFastChamferDistanceImageFilter.hxx"
178 #endif
179 
180 #endif
typename InputImageType::OffsetType OffsetType
typename NarrowBandType::Pointer NarrowBandPointer
typename InputImageType::PixelType PixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
This class compute the signed (positive and negative) chamfer distance in a narrow band...
typename InputImageType::RegionType RegionType
typename InputImageType::Pointer InputImagePointer
TOutputImage OutputImageType
Narrow Band class.
Definition: itkNarrowBand.h:51
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)