ITK  6.0.0
Insight Toolkit
itkTestingComparisonImageFilter.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 * https://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"
24#include <mutex>
25
26namespace itk
27{
28namespace Testing
29{
43template <typename TInputImage, typename TOutputImage>
44class ITK_TEMPLATE_EXPORT ComparisonImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(ComparisonImageFilter);
48
54
56 itkNewMacro(Self);
57
59 itkOverrideGetNameOfClassMacro(ComparisonImageFilter);
60
62 using InputImageType = TInputImage;
63 using InputPixelType = typename InputImageType::PixelType;
64 using OutputImageType = TOutputImage;
65 using OutputPixelType = typename OutputImageType::PixelType;
69
72
75
78 itkSetMacro(VerifyInputInformation, bool);
79 itkGetConstMacro(VerifyInputInformation, bool);
80 itkBooleanMacro(VerifyInputInformation);
85 itkSetMacro(ToleranceRadius, int);
86 itkGetConstMacro(ToleranceRadius, int);
91 itkSetMacro(DifferenceThreshold, OutputPixelType);
92 itkGetConstMacro(DifferenceThreshold, OutputPixelType);
98 itkSetMacro(IgnoreBoundaryPixels, bool);
99 itkGetConstMacro(IgnoreBoundaryPixels, bool);
100 itkBooleanMacro(IgnoreBoundaryPixels);
105 itkGetConstMacro(MinimumDifference, OutputPixelType);
106 itkGetConstMacro(MaximumDifference, OutputPixelType);
107 itkGetConstMacro(MeanDifference, RealType);
108 itkGetConstMacro(TotalDifference, AccumulateType);
109 itkGetConstMacro(NumberOfPixelsWithDifferences, SizeValueType);
112protected:
114 ~ComparisonImageFilter() override = default;
115
116 void
117 PrintSelf(std::ostream & os, Indent indent) const override;
118
122 void
124
125 void
127
128 void
130
131 void
132 VerifyInputInformation() const override;
133
134 OutputPixelType m_DifferenceThreshold{};
135
136 RealType m_MeanDifference{};
139 bool m_VerifyInputInformation{ true };
140
141 AccumulateType m_TotalDifference{};
142
143 SizeValueType m_NumberOfPixelsWithDifferences{ 0 };
144
145 int m_ToleranceRadius{ 0 };
146
147private:
148 bool m_IgnoreBoundaryPixels{ false };
149
150 std::mutex m_Mutex;
151};
152} // end namespace Testing
153} // end namespace itk
154
155#ifndef ITK_MANUAL_INSTANTIATION
156# include "itkTestingComparisonImageFilter.hxx"
157#endif
158
159
160#endif
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Define additional traits for native types such as int or float.
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Implements comparison between two images.
typename OutputImageType::PixelType OutputPixelType
void VerifyInputInformation() const override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
typename InputImageType::PixelType InputPixelType
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
void BeforeThreadedGenerateData() override
typename NumericTraits< RealType >::AccumulateType AccumulateType
~ComparisonImageFilter() override=default
itkSetInputMacro(ValidInput, InputImageType)
itkSetInputMacro(TestInput, InputImageType)
void PrintSelf(std::ostream &os, Indent indent) const override
typename NumericTraits< OutputPixelType >::RealType RealType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86