Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
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 // MITKCompareImageDataFilter_H
#define MITKCORE_EXPORT
#define MITK_INFO
Definition: mitkLogMacros.h:18
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
CompareFilterResults GetCompareResults()
Get the detailed results of the comparision run.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
A simple struct to hold the result of the comparison filter.
Superclass of all classes having one or more Images as input and generating Images as output...
Filter for comparing two mitk::Image objects by pixel values.
MITKCORE_EXPORT const ScalarType eps