ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkTestingComparisonImageFilter.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 __itkTestingComparisonImageFilter_h
19 #define __itkTestingComparisonImageFilter_h
20 
21 #include "itkArray.h"
22 #include "itkNumericTraits.h"
23 #include "itkImageSource.h"
24 
25 namespace itk
26 {
27 namespace Testing
28 {
41 template< class TInputImage, class TOutputImage >
42 class ITK_EXPORT ComparisonImageFilter:
43  public ImageSource< TOutputImage >
44 {
45 public:
51 
53  itkNewMacro(Self);
54 
57 
59  typedef TInputImage InputImageType;
60  typedef typename InputImageType::PixelType InputPixelType;
61  typedef TOutputImage OutputImageType;
62  typedef typename OutputImageType::PixelType OutputPixelType;
63  typedef typename OutputImageType::RegionType OutputImageRegionType;
66 
68  virtual void SetValidInput(const InputImageType *validImage);
69 
71  virtual void SetTestInput(const InputImageType *testImage);
72 
75  itkSetMacro(ToleranceRadius, int);
76  itkGetConstMacro(ToleranceRadius, int);
78 
81  itkSetMacro(DifferenceThreshold, OutputPixelType);
82  itkGetConstMacro(DifferenceThreshold, OutputPixelType);
84 
88  itkSetMacro(IgnoreBoundaryPixels, bool);
89  itkGetConstMacro(IgnoreBoundaryPixels, bool);
91 
94  itkGetConstMacro(MinimumDifference, OutputPixelType);
95  itkGetConstMacro(MaximumDifference, OutputPixelType);
96  itkGetConstMacro(MeanDifference, RealType);
97  itkGetConstMacro(TotalDifference, AccumulateType);
98  itkGetConstMacro(NumberOfPixelsWithDifferences, SizeValueType);
100 
102  using Superclass::SetInput;
103  virtual void SetInput(const TInputImage *image);
104  virtual void SetInput(unsigned int, const TInputImage *image);
105  const TInputImage * GetInput(void) const;
106  const TInputImage * GetInput(unsigned int idx) const;
108 
109 protected:
112 
113  void PrintSelf(std::ostream & os, Indent indent) const;
114 
124  void ThreadedGenerateData(const OutputImageRegionType & threadRegion,
125  ThreadIdType threadId);
126 
127  void BeforeThreadedGenerateData();
128 
129  void AfterThreadedGenerateData();
130 
132 
136 
138 
140 
142 
145 
148 
149 private:
150  ComparisonImageFilter(const Self &); //purposely not implemented
151  void operator=(const Self &); //purposely not implemented
152 
154 };
155 } // end namespace Testing
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkTestingComparisonImageFilter.hxx"
160 #endif
161 
162 
163 #endif
164