Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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:
68  itkSimpleNewMacro(Self);
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 
95  void ResetCompareResultsToInitial();
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
mitk::eps
const MITKCORE_EXPORT ScalarType eps
mitk::CompareFilterResults::m_MaximumDifference
double m_MaximumDifference
Definition: mitkCompareImageDataFilter.h:47
mitkImageToImageFilter.h
MITK_INFO
#define MITK_INFO
Definition: mitkLog.h:209
mitkImage.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::CompareImageDataFilter::m_Tolerance
double m_Tolerance
Definition: mitkCompareImageDataFilter.h:104
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::CompareFilterResults
A simple struct to hold the result of the comparison filter.
Definition: mitkCompareImageDataFilter.h:28
mitk::CompareFilterResults::m_MeanDifference
double m_MeanDifference
Definition: mitkCompareImageDataFilter.h:50
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::CompareImageDataFilter::m_CompareDetails
CompareFilterResults m_CompareDetails
Definition: mitkCompareImageDataFilter.h:103
mitk::CompareFilterResults::m_FilterCompleted
bool m_FilterCompleted
Definition: mitkCompareImageDataFilter.h:53
mitk::CompareImageDataFilter::m_CompareResult
bool m_CompareResult
Definition: mitkCompareImageDataFilter.h:101
mitk::CompareFilterResults::m_MinimumDifference
double m_MinimumDifference
Definition: mitkCompareImageDataFilter.h:46
mitk::CompareImageDataFilter::GetCompareResults
CompareFilterResults GetCompareResults()
Get the detailed results of the comparison run.
Definition: mitkCompareImageDataFilter.h:87
mitk::CompareFilterResults::m_TotalDifference
double m_TotalDifference
Definition: mitkCompareImageDataFilter.h:49
mitk::CompareImageDataFilter::~CompareImageDataFilter
~CompareImageDataFilter() override
Definition: mitkCompareImageDataFilter.h:91
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::CompareFilterResults::m_PixelsWithDifference
size_t m_PixelsWithDifference
Definition: mitkCompareImageDataFilter.h:51
mitk::CompareFilterResults::PrintSelf
void PrintSelf()
Definition: mitkCompareImageDataFilter.h:30
mitk::CompareFilterResults::m_ExceptionMessage
std::string m_ExceptionMessage
Definition: mitkCompareImageDataFilter.h:54
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::CompareImageDataFilter::SetTolerance
void SetTolerance(double eps)
Definition: mitkCompareImageDataFilter.h:88
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25
mitk::CompareImageDataFilter
Filter for comparing two mitk::Image objects by pixel values.
Definition: mitkCompareImageDataFilter.h:64