Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
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 (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 mitkCalculateGrayValueStatisticsTool_h_Included
14 #define mitkCalculateGrayValueStatisticsTool_h_Included
15 
16 #include "mitkCommon.h"
19 
20 #ifndef __itkHistogram_h
21 #include <itkHistogram.h>
22 #endif
23 
24 #include <itkImage.h>
25 #include <sstream>
26 
27 namespace mitk
28 {
39  {
40  public:
42 
44  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
45 
46  const char **GetXPM() const override;
47  const char *GetName() const override;
48 
49  virtual std::string GetReport() const;
50  //
51  // Insight/Code/Review/Algorithms version of Histogram takes
52  // only one template parameter, and the 'release' version
53  // takes 2, but the default value for the second, 1, is what
54  // was specified here.
55  typedef itk::Statistics::Histogram<double> HistogramType;
56  HistogramType::Pointer m_ITKHistogram;
57 
58  HistogramType::ConstPointer GetHistogram();
59 
60  typedef HistogramType::MeasurementType HistogramMeasurementType;
61 
62  protected:
63  CalculateGrayValueStatisticsTool(); // purposely hidden
65 
66  void StartProcessingAllData() override;
67  bool ProcessOneWorkingData(DataNode *node) override;
68  void FinishProcessingAllData() override;
69 
70  std::string GetErrorMessage() override;
71 
75  template <typename TPixel, unsigned int VImageDimension>
76  void CalculateMinMax(itk::Image<TPixel, VImageDimension> *referenceImage,
77  Image *segmentation,
78  TPixel &minimum,
79  TPixel &maximum);
80 
85  template <typename TPixel, unsigned int VImageDimension>
86  void ITKHistogramming(itk::Image<TPixel, VImageDimension> *referenceImage,
87  Image *segmentation,
88  std::stringstream &report);
89 
90  std::stringstream m_CompleteReport;
91  };
92 
93 } // namespace
94 
95 #endif
#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:40
Image class for storing images.
Definition: mitkImage.h:72
Calculates some gray value statistics for segmentations.
Event/message/notification class.
Definition: mitkMessage.h:568
static std::string GetName(std::string fileName, std::string suffix)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Super-class that provides the functionality of a StateMachine to DataInteractors. ...