Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkCalculateGrayValueStatisticsTool.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 mitkCalculateGrayValueStatisticsTool_h_Included
18 #define mitkCalculateGrayValueStatisticsTool_h_Included
19 
20 #include "mitkCommon.h"
23 
24 #ifndef __itkHistogram_h
25 #include <itkHistogram.h>
26 #endif
27 
28 #include <itkImage.h>
29 #include <sstream>
30 
31 namespace mitk
32 {
43  {
44  public:
46 
48  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
49 
50  virtual const char **GetXPM() const override;
51  virtual const char *GetName() const override;
52 
53  virtual std::string GetReport() const;
54  //
55  // Insight/Code/Review/Algorithms version of Histogram takes
56  // only one template parameter, and the 'release' version
57  // takes 2, but the default value for the second, 1, is what
58  // was specified here.
59  typedef itk::Statistics::Histogram<double> HistogramType;
60  HistogramType::Pointer m_ITKHistogram;
61 
62  HistogramType::ConstPointer GetHistogram();
63 
64  typedef HistogramType::MeasurementType HistogramMeasurementType;
65 
66  protected:
67  CalculateGrayValueStatisticsTool(); // purposely hidden
68  virtual ~CalculateGrayValueStatisticsTool();
69 
70  virtual void StartProcessingAllData() override;
71  virtual bool ProcessOneWorkingData(DataNode *node) override;
72  virtual void FinishProcessingAllData() override;
73 
74  virtual std::string GetErrorMessage() override;
75 
79  template <typename TPixel, unsigned int VImageDimension>
80  void CalculateMinMax(itk::Image<TPixel, VImageDimension> *referenceImage,
81  Image *segmentation,
82  TPixel &minimum,
83  TPixel &maximum);
84 
89  template <typename TPixel, unsigned int VImageDimension>
90  void ITKHistogramming(itk::Image<TPixel, VImageDimension> *referenceImage,
91  Image *segmentation,
92  std::stringstream &report);
93 
94  std::stringstream m_CompleteReport;
95  };
96 
97 } // namespace
98 
99 #endif
STL namespace.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Batch processing of all selected segmentations/data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
Calculates some gray value statistics for segmentations.
Event/message/notification class.
Definition: mitkMessage.h:572
static std::string GetName(std::string fileName, std::string suffix)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
Super-class that provides the functionality of a StateMachine to DataInteractors. ...