Medical Imaging Interaction Toolkit  2018.4.99-eed36131
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);
45  itkCloneMacro(Self);
46 
47  const char **GetXPM() const override;
48  const char *GetName() const override;
49 
50  virtual std::string GetReport() const;
51  //
52  // Insight/Code/Review/Algorithms version of Histogram takes
53  // only one template parameter, and the 'release' version
54  // takes 2, but the default value for the second, 1, is what
55  // was specified here.
56  typedef itk::Statistics::Histogram<double> HistogramType;
57  HistogramType::Pointer m_ITKHistogram;
58 
59  HistogramType::ConstPointer GetHistogram();
60 
61  typedef HistogramType::MeasurementType HistogramMeasurementType;
62 
63  protected:
64  CalculateGrayValueStatisticsTool(); // purposely hidden
66 
67  void StartProcessingAllData() override;
68  bool ProcessOneWorkingData(DataNode *node) override;
69  void FinishProcessingAllData() override;
70 
71  std::string GetErrorMessage() override;
72 
76  template <typename TPixel, unsigned int VImageDimension>
77  void CalculateMinMax(itk::Image<TPixel, VImageDimension> *referenceImage,
78  Image *segmentation,
79  TPixel &minimum,
80  TPixel &maximum);
81 
86  template <typename TPixel, unsigned int VImageDimension>
87  void ITKHistogramming(itk::Image<TPixel, VImageDimension> *referenceImage,
88  Image *segmentation,
89  std::stringstream &report);
90 
91  std::stringstream m_CompleteReport;
92  };
93 
94 } // namespace
95 
96 #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:57
Super-class that provides the functionality of a StateMachine to DataInteractors. ...