ITK  5.1.0
Insight Toolkit
itkDirectedHausdorffDistanceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkDirectedHausdorffDistanceImageFilter_h
19 #define itkDirectedHausdorffDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkArray.h"
25 
26 namespace itk
27 {
72 template <typename TInputImage1, typename TInputImage2>
73 class ITK_TEMPLATE_EXPORT DirectedHausdorffDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_ASSIGN(DirectedHausdorffDistanceImageFilter);
77 
83 
85  itkNewMacro(Self);
86 
89 
91  using InputImage1Type = TInputImage1;
92  using InputImage2Type = TInputImage2;
93  using InputImage1Pointer = typename TInputImage1::Pointer;
94  using InputImage2Pointer = typename TInputImage2::Pointer;
95  using InputImage1ConstPointer = typename TInputImage1::ConstPointer;
96  using InputImage2ConstPointer = typename TInputImage2::ConstPointer;
97 
99  using SizeType = typename TInputImage1::SizeType;
101 
102  using InputImage1PixelType = typename TInputImage1::PixelType;
103  using InputImage2PixelType = typename TInputImage2::PixelType;
104 
106  static constexpr unsigned int ImageDimension = TInputImage1::ImageDimension;
107 
110 
112  void
113  SetInput1(const InputImage1Type * image);
114 
116  void
117  SetInput2(const InputImage2Type * image);
118 
120  const InputImage1Type *
121  GetInput1();
122 
124  const InputImage2Type *
125  GetInput2();
126 
128  itkSetMacro(UseImageSpacing, bool);
129  itkGetConstMacro(UseImageSpacing, bool);
131 
133  itkGetConstMacro(DirectedHausdorffDistance, RealType);
134  itkGetConstMacro(AverageHausdorffDistance, RealType);
136 
137 #ifdef ITK_USE_CONCEPT_CHECKING
138  // Begin concept checking
140  // End concept checking
141 #endif
142 
143 protected:
145  ~DirectedHausdorffDistanceImageFilter() override = default;
146  void
147  PrintSelf(std::ostream & os, Indent indent) const override;
148 
151  void
152  AllocateOutputs() override;
153 
155  void
156  BeforeThreadedGenerateData() override;
157 
160  void
161  AfterThreadedGenerateData() override;
162 
164  void
165  ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType threadId) override;
166 
167  void
169  {
170  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
171  }
172 
173  // Override since the filter needs all the data for the algorithm
174  void
175  GenerateInputRequestedRegion() override;
176 
177  // Override since the filter produces all of its output
178  void
179  EnlargeOutputRequestedRegion(DataObject * data) override;
180 
181 private:
184 
185 
187 
190 
192  std::vector<CompensatedSummationType> m_Sum;
193 
197 }; // end of class
198 } // end namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 # include "itkDirectedHausdorffDistanceImageFilter.hxx"
202 #endif
203 
204 #endif
itk::DirectedHausdorffDistanceImageFilter::m_MaxDistance
Array< RealType > m_MaxDistance
Definition: itkDirectedHausdorffDistanceImageFilter.h:188
itk::DirectedHausdorffDistanceImageFilter::m_DistanceMap
DistanceMapPointer m_DistanceMap
Definition: itkDirectedHausdorffDistanceImageFilter.h:186
itk::DirectedHausdorffDistanceImageFilter::InputImage2Type
TInputImage2 InputImage2Type
Definition: itkDirectedHausdorffDistanceImageFilter.h:92
itk::DirectedHausdorffDistanceImageFilter::m_DirectedHausdorffDistance
RealType m_DirectedHausdorffDistance
Definition: itkDirectedHausdorffDistanceImageFilter.h:194
itk::CompensatedSummation< RealType >
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:712
itk::DirectedHausdorffDistanceImageFilter::InputImage1Type
TInputImage1 InputImage1Type
Definition: itkDirectedHausdorffDistanceImageFilter.h:91
itk::DirectedHausdorffDistanceImageFilter::DynamicThreadedGenerateData
void DynamicThreadedGenerateData(const RegionType &) override
Definition: itkDirectedHausdorffDistanceImageFilter.h:168
itk::DirectedHausdorffDistanceImageFilter::SizeType
typename TInputImage1::SizeType SizeType
Definition: itkDirectedHausdorffDistanceImageFilter.h:99
itk::DirectedHausdorffDistanceImageFilter::m_Sum
std::vector< CompensatedSummationType > m_Sum
Definition: itkDirectedHausdorffDistanceImageFilter.h:192
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkCompensatedSummation.h
itk::DirectedHausdorffDistanceImageFilter::DistanceMapPointer
typename DistanceMapType::Pointer DistanceMapPointer
Definition: itkDirectedHausdorffDistanceImageFilter.h:183
itk::DirectedHausdorffDistanceImageFilter::RegionType
typename TInputImage1::RegionType RegionType
Definition: itkDirectedHausdorffDistanceImageFilter.h:98
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DirectedHausdorffDistanceImageFilter::InputImage2PixelType
typename TInputImage2::PixelType InputImage2PixelType
Definition: itkDirectedHausdorffDistanceImageFilter.h:103
itk::DirectedHausdorffDistanceImageFilter::InputImage2Pointer
typename TInputImage2::Pointer InputImage2Pointer
Definition: itkDirectedHausdorffDistanceImageFilter.h:94
itk::DirectedHausdorffDistanceImageFilter::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkDirectedHausdorffDistanceImageFilter.h:196
itk::DirectedHausdorffDistanceImageFilter::InputImage2ConstPointer
typename TInputImage2::ConstPointer InputImage2ConstPointer
Definition: itkDirectedHausdorffDistanceImageFilter.h:96
itk::DirectedHausdorffDistanceImageFilter::m_PixelCount
Array< IdentifierType > m_PixelCount
Definition: itkDirectedHausdorffDistanceImageFilter.h:189
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::DirectedHausdorffDistanceImageFilter
Computes the directed Hausdorff distance between the set of non-zero pixels of two images.
Definition: itkDirectedHausdorffDistanceImageFilter.h:73
itkImageToImageFilter.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itkArray.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::Array< RealType >
itkNumericTraits.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::DirectedHausdorffDistanceImageFilter::m_AverageHausdorffDistance
RealType m_AverageHausdorffDistance
Definition: itkDirectedHausdorffDistanceImageFilter.h:195
itk::DirectedHausdorffDistanceImageFilter::IndexType
typename TInputImage1::IndexType IndexType
Definition: itkDirectedHausdorffDistanceImageFilter.h:100
itk::DirectedHausdorffDistanceImageFilter::InputImage1PixelType
typename TInputImage1::PixelType InputImage1PixelType
Definition: itkDirectedHausdorffDistanceImageFilter.h:102
itk::DirectedHausdorffDistanceImageFilter::InputImage1ConstPointer
typename TInputImage1::ConstPointer InputImage1ConstPointer
Definition: itkDirectedHausdorffDistanceImageFilter.h:95
itk::DirectedHausdorffDistanceImageFilter::RealType
typename NumericTraits< InputImage1PixelType >::RealType RealType
Definition: itkDirectedHausdorffDistanceImageFilter.h:109
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::DirectedHausdorffDistanceImageFilter::InputImage1Pointer
typename TInputImage1::Pointer InputImage1Pointer
Definition: itkDirectedHausdorffDistanceImageFilter.h:93