Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKCOMPAREIMAGEDATAFILTER_H
18 #define MITKCOMPAREIMAGEDATAFILTER_H
19 
20 // MITK
21 #include "mitkImage.h"
22 #include "mitkImageToImageFilter.h"
23 
24 // ITK
25 #include <itkImage.h>
26 
27 namespace mitk
28 {
33  {
34  void PrintSelf()
35  {
36  if (!m_FilterCompleted)
37  {
38  MITK_INFO << "Comparison filter terminated due to an exception: \n " << m_ExceptionMessage;
39 
40  return;
41  }
42 
43  MITK_INFO << "Min. difference: " << m_MinimumDifference << "\n"
44  << "Max. difference: " << m_MaximumDifference << "\n"
45  << "Total difference: " << m_TotalDifference << "\n"
46  << "Mean difference: " << m_MeanDifference << "\n"
47  << "Number of pixels with differences: " << m_PixelsWithDifference;
48  }
49 
52 
56 
58  std::string m_ExceptionMessage;
59  };
60 
69  {
70  public:
72 
73  itkSimpleNewMacro(Self)
74 
85  bool GetResult(size_t threshold = 0);
86 
92  CompareFilterResults GetCompareResults() { return m_CompareDetails; }
93  void SetTolerance(double eps) { m_Tolerance = eps; }
94  protected:
97  virtual void GenerateData() override;
98 
100  void ResetCompareResultsToInitial();
101 
103  template <typename TPixel, unsigned int VImageDimension>
104  void EstimateValueDifference(const itk::Image<TPixel, VImageDimension> *itkImage1,
105  const mitk::Image *referenceImage);
107 
109  double m_Tolerance;
110  };
111 } // end namespace mitk
112 
113 #endif // MITKCompareImageDataFilter_H
#define MITKCORE_EXPORT
#define MITK_INFO
Definition: mitkLogMacros.h:22
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
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