ITK  4.12.0
Insight Segmentation and Registration Toolkit
itkHausdorffDistanceImageFilter.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 itkHausdorffDistanceImageFilter_h
19 #define itkHausdorffDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
61 template< typename TInputImage1, typename TInputImage2 >
62 class ITK_TEMPLATE_EXPORT HausdorffDistanceImageFilter:
63  public ImageToImageFilter< TInputImage1, TInputImage1 >
64 {
65 public:
71 
73  itkNewMacro(Self);
74 
77 
79  typedef TInputImage1 InputImage1Type;
80  typedef TInputImage2 InputImage2Type;
85 
86  typedef typename TInputImage1::RegionType RegionType;
87  typedef typename TInputImage1::SizeType SizeType;
88  typedef typename TInputImage1::IndexType IndexType;
89 
90  typedef typename TInputImage1::PixelType InputImage1PixelType;
91  typedef typename TInputImage2::PixelType InputImage2PixelType;
92 
94  itkStaticConstMacro(ImageDimension, unsigned int,
95  TInputImage1::ImageDimension);
96 
99 
101  void SetInput1(const InputImage1Type *image);
102 
104  void SetInput2(const InputImage2Type *image);
105 
107  const InputImage1Type * GetInput1();
108 
110  const InputImage2Type * GetInput2();
111 
113  itkSetMacro(UseImageSpacing, bool);
114  itkGetConstMacro( UseImageSpacing, bool );
116 
118  itkGetConstMacro(HausdorffDistance, RealType);
119  itkGetConstMacro(AverageHausdorffDistance, RealType);
121 
122 #ifdef ITK_USE_CONCEPT_CHECKING
123  // Begin concept checking
124  itkConceptMacro( Input1HasNumericTraitsCheck,
126  // End concept checking
127 #endif
128 
129 protected:
132  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
133 
135  void GenerateData() ITK_OVERRIDE;
136 
137  // Override since the filter needs all the data for the algorithm
138  void GenerateInputRequestedRegion() ITK_OVERRIDE;
139 
140  // Override since the filter produces all of its output
141  void EnlargeOutputRequestedRegion(DataObject *data) ITK_OVERRIDE;
142 
143 private:
144  ITK_DISALLOW_COPY_AND_ASSIGN(HausdorffDistanceImageFilter);
145 
146  RealType m_HausdorffDistance;
147  RealType m_AverageHausdorffDistance;
148  bool m_UseImageSpacing;
149 }; // end of class
150 } // end namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkHausdorffDistanceImageFilter.hxx"
154 #endif
155 
156 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
NumericTraits< InputImage1PixelType >::RealType RealType
ImageToImageFilter< TInputImage1, TInputImage1 > Superclass
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
Base class for all data objects in ITK.
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 additional traits for native types such as int or float.
Computes the Hausdorff distance between the set of non-zero pixels of two images. ...
#define itkConceptMacro(name, concept)