Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkHistogramGenerator.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 HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
18 #define HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
19 
20 #include "mitkImage.h"
21 #include <itkHistogram.h>
22 #include <itkImage.h>
23 #include <itkObject.h>
24 
25 namespace mitk
26 {
27  //##Documentation
28  //## @brief Provides an easy way to calculate an itk::Histogram for a mitk::Image
29  //##
30  class MITKCORE_EXPORT HistogramGenerator : public itk::Object
31  {
32  public:
34 
35  itkFactorylessNewMacro(Self) itkCloneMacro(Self) typedef itk::Statistics::Histogram<double> HistogramType;
36 
37  itkSetMacro(Image, mitk::Image::ConstPointer);
38  itkSetMacro(Size, int);
39  itkGetConstMacro(Size, int);
40  itkGetConstObjectMacro(Histogram, HistogramType);
41 
42  // TODO: calculate if needed in GetHistogram()
43  void ComputeHistogram();
44  float GetMaximumFrequency() const;
45  static float CalculateMaximumFrequency(const HistogramType *histogram);
46 
47  protected:
49 
50  virtual ~HistogramGenerator();
51 
52  mitk::Image::ConstPointer m_Image;
53  int m_Size;
54  HistogramType::ConstPointer m_Histogram;
55  };
56 
57 } // namespace mitk
58 
59 #endif /* HISTOGRAM_GENERATOR_H_HEADER_INCLUDED */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Image class for storing images.
Definition: mitkImage.h:76
itk::Statistics::Histogram< double > HistogramType
Provides an easy way to calculate an itk::Histogram for a mitk::Image.