Medical Imaging Interaction Toolkit  2026.06.00
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 (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 mitkHistogramGenerator_h
14 #define mitkHistogramGenerator_h
15 
16 #include <mitkImage.h>
17 #include <itkHistogram.h>
18 #include <itkImage.h>
19 #include <itkObject.h>
20 
21 namespace mitk
22 {
28  class MITKCORE_EXPORT HistogramGenerator : public itk::Object
29  {
30  public:
32 
33  itkFactorylessNewMacro(Self);
34 
35  itkCloneMacro(Self) typedef itk::Statistics::Histogram<double> HistogramType;
36 
38  itkSetMacro(Image, mitk::Image::ConstPointer);
39 
41  itkSetMacro(Size, int);
42 
44  itkGetConstMacro(Size, int);
45 
47  itkGetConstObjectMacro(Histogram, HistogramType);
48 
56 
62  float GetMaximumFrequency() const;
63 
70  static float CalculateMaximumFrequency(const HistogramType *histogram);
71 
72  protected:
74 
75  ~HistogramGenerator() override;
76 
77  mitk::Image::ConstPointer m_Image;
78  int m_Size;
79  HistogramType::ConstPointer m_Histogram;
80  };
81 
82 } // namespace mitk
83 
84 #endif
#define MITKCORE_EXPORT
Provides an easy way to calculate an itk::Histogram for a mitk::Image.
void ComputeHistogram()
Compute the histogram from the input image.
static float CalculateMaximumFrequency(const HistogramType *histogram)
Calculate the maximum frequency in a given histogram.
~HistogramGenerator() override
float GetMaximumFrequency() const
Get the maximum frequency in the computed histogram.
mitk::Image::ConstPointer m_Image
itk::Statistics::Histogram< double > HistogramType
mitkClassMacroItkParent(HistogramGenerator, itk::Object)
HistogramType::ConstPointer m_Histogram
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Find image slices visible on a given plane.