Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 
69  itkSimpleNewMacro(Self)
70 
71 
81  bool GetResult(size_t threshold = 0);
82 
88  CompareFilterResults GetCompareResults() { return m_CompareDetails; }
89  void SetTolerance(double eps) { m_Tolerance = eps; }
90  protected:
93  void GenerateData() override;
94 
96  void ResetCompareResultsToInitial();
97 
99  template <typename TPixel, unsigned int VImageDimension>
100  void EstimateValueDifference(const itk::Image<TPixel, VImageDimension> *itkImage1,
101  const mitk::Image *referenceImage);
103 
105  double m_Tolerance;
106  };
107 } // end namespace mitk
108 
109 #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