Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
itkMITKScalarImageToHistogramGenerator.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 __itkMITKScalarImageToHistogramGenerator_h
14 #define __itkMITKScalarImageToHistogramGenerator_h
15 
16 #include <itkImageToListSampleAdaptor.h>
17 #include <itkObject.h>
18 #include <itkSampleToHistogramFilter.h>
19 
20 namespace itk
21 {
22  namespace Statistics
23  {
24  template <class TImageType, class TMeasurementType = typename TImageType::PixelType>
26  {
27  public:
30  typedef Object Superclass;
33 
35  itkTypeMacro(MITKScalarImageToHistogramGenerator, Object);
36 
38  itkFactorylessNewMacro(Self);
39  itkCloneMacro(Self);
40 
41  typedef TImageType ImageType;
42  typedef itk::Statistics::ImageToListSampleAdaptor<ImageType> AdaptorType;
43  typedef typename AdaptorType::Pointer AdaptorPointer;
44  typedef typename ImageType::PixelType PixelType;
45 
46  typedef itk::Statistics::Histogram<TMeasurementType, itk::Statistics::DenseFrequencyContainer2> HistogramType;
47  typedef itk::Statistics::SampleToHistogramFilter<AdaptorType, HistogramType> GeneratorType;
48 
49  typedef typename GeneratorType::Pointer GeneratorPointer;
50 
51  typedef typename HistogramType::Pointer HistogramPointer;
52  typedef typename HistogramType::ConstPointer HistogramConstPointer;
53 
54  public:
56  void Compute(void);
57 
59  void SetInput(const ImageType *);
60 
64  const HistogramType *GetOutput() const;
65 
67  void SetNumberOfBins(unsigned int numberOfBins);
68 
70  void SetMarginalScale(double marginalScale);
71 
72  protected:
75  void PrintSelf(std::ostream &os, Indent indent) const override;
76 
77  private:
78  AdaptorPointer m_ImageToListAdaptor;
79 
80  GeneratorPointer m_HistogramGenerator;
81  };
82 
83  } // end of namespace Statistics
84 } // end of namespace itk
85 
86 #ifndef ITK_MANUAL_INSTANTIATION
88 #endif
89 
90 #endif
itk::Statistics::Histogram< TMeasurementType, itk::Statistics::DenseFrequencyContainer2 > HistogramType
itk::Statistics::SampleToHistogramFilter< AdaptorType, HistogramType > GeneratorType
itk::Statistics::ImageToListSampleAdaptor< ImageType > AdaptorType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfBins(unsigned int numberOfBins)