00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __itkMITKScalarImageToHistogramGenerator_h 00019 #define __itkMITKScalarImageToHistogramGenerator_h 00020 00021 00022 #include "itkScalarImageToListAdaptor.h" 00023 #include "itkListSampleToHistogramGenerator.h" 00024 #include "itkObject.h" 00025 00026 00027 namespace itk { 00028 namespace Statistics { 00029 00030 template< class TImageType, class TMeasurementType = 00031 ITK_TYPENAME TImageType::PixelType> 00032 class MITKScalarImageToHistogramGenerator : public Object 00033 { 00034 public: 00036 typedef MITKScalarImageToHistogramGenerator Self; 00037 typedef Object Superclass; 00038 typedef SmartPointer<Self> Pointer; 00039 typedef SmartPointer<const Self> ConstPointer; 00040 00042 itkTypeMacro(MITKScalarImageToHistogramGenerator, Object); 00043 00045 itkNewMacro(Self); 00046 00047 typedef TImageType ImageType; 00048 typedef itk::Statistics::ScalarImageToListAdaptor< 00049 ImageType 00050 > AdaptorType; 00051 typedef typename AdaptorType::Pointer AdaptorPointer; 00052 typedef typename ImageType::PixelType PixelType; 00053 00054 typedef itk::Statistics::ListSampleToHistogramGenerator< 00055 AdaptorType, 00056 TMeasurementType 00057 > GeneratorType; 00058 00059 typedef typename GeneratorType::Pointer GeneratorPointer; 00060 00061 typedef typename GeneratorType::HistogramType HistogramType; 00062 typedef typename HistogramType::Pointer HistogramPointer; 00063 typedef typename HistogramType::ConstPointer HistogramConstPointer; 00064 00065 public: 00066 00068 void Compute( void ); 00069 00071 void SetInput( const ImageType * ); 00072 00076 const HistogramType * GetOutput() const; 00077 00079 void SetNumberOfBins( unsigned int numberOfBins ); 00080 00082 void SetMarginalScale( double marginalScale ); 00083 00084 00085 protected: 00086 MITKScalarImageToHistogramGenerator(); 00087 virtual ~MITKScalarImageToHistogramGenerator() {}; 00088 void PrintSelf(std::ostream& os, Indent indent) const; 00089 00090 00091 private: 00092 00093 AdaptorPointer m_ImageToListAdaptor; 00094 00095 GeneratorPointer m_HistogramGenerator; 00096 00097 }; 00098 00099 00100 } // end of namespace Statistics 00101 } // end of namespace itk 00102 00103 #ifndef ITK_MANUAL_INSTANTIATION 00104 #include "itkMITKScalarImageToHistogramGenerator.txx" 00105 #endif 00106 00107 #endif