ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkDirectedHausdorffDistanceImageFilter.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 __itkDirectedHausdorffDistanceImageFilter_h
19 #define __itkDirectedHausdorffDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkArray.h"
25 
26 namespace itk
27 {
71 template< class TInputImage1, class TInputImage2 >
73  public ImageToImageFilter< TInputImage1, TInputImage1 >
74 {
75 public:
81 
83  itkNewMacro(Self);
84 
87 
89  typedef TInputImage1 InputImage1Type;
90  typedef TInputImage2 InputImage2Type;
91  typedef typename TInputImage1::Pointer InputImage1Pointer;
92  typedef typename TInputImage2::Pointer InputImage2Pointer;
93  typedef typename TInputImage1::ConstPointer InputImage1ConstPointer;
94  typedef typename TInputImage2::ConstPointer InputImage2ConstPointer;
95 
96  typedef typename TInputImage1::RegionType RegionType;
97  typedef typename TInputImage1::SizeType SizeType;
98  typedef typename TInputImage1::IndexType IndexType;
99 
100  typedef typename TInputImage1::PixelType InputImage1PixelType;
101  typedef typename TInputImage2::PixelType InputImage2PixelType;
102 
104  itkStaticConstMacro(ImageDimension, unsigned int,
105  TInputImage1::ImageDimension);
106 
109 
111  void SetInput1(const InputImage1Type *image);
112 
114  void SetInput2(const InputImage2Type *image);
115 
117  const InputImage1Type * GetInput1(void);
118 
120  const InputImage2Type * GetInput2(void);
121 
123  itkSetMacro(UseImageSpacing, bool);
124  itkGetConstMacro( UseImageSpacing, bool );
126 
128  itkGetConstMacro(DirectedHausdorffDistance, RealType);
129  itkGetConstMacro(AverageHausdorffDistance, RealType);
131 
132 #ifdef ITK_USE_CONCEPT_CHECKING
133 
134  itkConceptMacro( InputHasNumericTraitsCheck,
136 
138 #endif
139 
140 protected:
143  void PrintSelf(std::ostream & os, Indent indent) const;
144 
147  void AllocateOutputs();
148 
150  void BeforeThreadedGenerateData();
151 
154  void AfterThreadedGenerateData();
155 
157  void ThreadedGenerateData(const RegionType &
158  outputRegionForThread,
159  ThreadIdType threadId);
160 
161  // Override since the filter needs all the data for the algorithm
162  void GenerateInputRequestedRegion();
163 
164  // Override since the filter produces all of its output
165  void EnlargeOutputRequestedRegion(DataObject *data);
166 
167 private:
168  DirectedHausdorffDistanceImageFilter(const Self &); //purposely not implemented
169  void operator=(const Self &); //purposely not implemented
170 
173 
174 
176 
179 
181  std::vector< CompensatedSummationType > m_Sum;
182 
186 }; // end of class
187 } // end namespace itk
188 
189 #ifndef ITK_MANUAL_INSTANTIATION
190 #include "itkDirectedHausdorffDistanceImageFilter.hxx"
191 #endif
192 
193 #endif
194