Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 __itkMITKScalarImageToHistogramGenerator_h
18 #define __itkMITKScalarImageToHistogramGenerator_h
19 
20 #include <itkImageToListSampleAdaptor.h>
21 #include <itkObject.h>
22 #include <itkSampleToHistogramFilter.h>
23 
24 namespace itk
25 {
26  namespace Statistics
27  {
28  template <class TImageType, class TMeasurementType = typename TImageType::PixelType>
30  {
31  public:
34  typedef Object Superclass;
37 
39  itkTypeMacro(MITKScalarImageToHistogramGenerator, Object);
40 
42  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
43 
44  typedef TImageType ImageType;
45  typedef itk::Statistics::ImageToListSampleAdaptor<ImageType> AdaptorType;
46  typedef typename AdaptorType::Pointer AdaptorPointer;
47  typedef typename ImageType::PixelType PixelType;
48 
49  typedef itk::Statistics::Histogram<TMeasurementType, itk::Statistics::DenseFrequencyContainer2> HistogramType;
50  typedef itk::Statistics::SampleToHistogramFilter<AdaptorType, HistogramType> GeneratorType;
51 
52  typedef typename GeneratorType::Pointer GeneratorPointer;
53 
54  typedef typename HistogramType::Pointer HistogramPointer;
55  typedef typename HistogramType::ConstPointer HistogramConstPointer;
56 
57  public:
59  void Compute(void);
60 
62  void SetInput(const ImageType *);
63 
67  const HistogramType *GetOutput() const;
68 
70  void SetNumberOfBins(unsigned int numberOfBins);
71 
73  void SetMarginalScale(double marginalScale);
74 
75  protected:
77  virtual ~MITKScalarImageToHistogramGenerator(){};
78  void PrintSelf(std::ostream &os, Indent indent) const override;
79 
80  private:
81  AdaptorPointer m_ImageToListAdaptor;
82 
83  GeneratorPointer m_HistogramGenerator;
84  };
85 
86  } // end of namespace Statistics
87 } // end of namespace itk
88 
89 #ifndef ITK_MANUAL_INSTANTIATION
91 #endif
92 
93 #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)