Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkCompareImageDataFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkCompareImageDataFilter_h
14 #define mitkCompareImageDataFilter_h
15 
16 // MITK
17 #include "mitkImage.h"
18 #include "mitkImageToImageFilter.h"
19 
20 // ITK
21 #include <itkImage.h>
22 
23 namespace mitk
24 {
29  {
30  void PrintSelf()
31  {
32  if (!m_FilterCompleted)
33  {
34  MITK_INFO << "Comparison filter terminated due to an exception: \n " << m_ExceptionMessage;
35 
36  return;
37  }
38 
39  MITK_INFO << "Min. difference: " << m_MinimumDifference << "\n"
40  << "Max. difference: " << m_MaximumDifference << "\n"
41  << "Total difference: " << m_TotalDifference << "\n"
42  << "Mean difference: " << m_MeanDifference << "\n"
43  << "Number of pixels with differences: " << m_PixelsWithDifference;
44  }
45 
48 
52 
54  std::string m_ExceptionMessage;
55  };
56 
65  {
66  public:
69 
80  bool GetResult(size_t threshold = 0);
81 
87  CompareFilterResults GetCompareResults() { return m_CompareDetails; }
88  void SetTolerance(double eps) { m_Tolerance = eps; }
89  protected:
92  void GenerateData() override;
93 
96 
98  template <typename TPixel, unsigned int VImageDimension>
99  void EstimateValueDifference(const itk::Image<TPixel, VImageDimension> *itkImage1,
100  const mitk::Image *referenceImage);
102 
104  double m_Tolerance;
105  };
106 } // end namespace mitk
107 
108 #endif
#define MITKCORE_EXPORT
Filter for comparing two mitk::Image objects by pixel values.
void ResetCompareResultsToInitial()
Method resets the compare detail member struct to its initial state.
void GenerateData() override
CompareFilterResults GetCompareResults()
Get the detailed results of the comparison run.
bool GetResult(size_t threshold=0)
Get the result of the comparison.
void EstimateValueDifference(const itk::Image< TPixel, VImageDimension > *itkImage1, const mitk::Image *referenceImage)
Superclass of all classes having one or more Images as input and generating Images as output.
Image class for storing images.
Definition: mitkImage.h:70
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
#define MITK_INFO
Definition: mitkLog.h:209
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
A simple struct to hold the result of the comparison filter.