00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkScalarImageToHistogramGenerator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-01-16 11:37:58 $ 00007 Version: $Revision: 1.9 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 #ifndef __itkScalarImageToHistogramGenerator_h 00018 #define __itkScalarImageToHistogramGenerator_h 00019 00020 00021 #include "itkScalarImageToListAdaptor.h" 00022 #include "itkListSampleToHistogramGenerator.h" 00023 #include "itkObject.h" 00024 00025 00026 namespace itk { 00027 namespace Statistics { 00028 00033 template< class TImageType > 00034 class ScalarImageToHistogramGenerator : public Object 00035 { 00036 public: 00038 typedef ScalarImageToHistogramGenerator Self ; 00039 typedef Object Superclass; 00040 typedef SmartPointer<Self> Pointer; 00041 typedef SmartPointer<const Self> ConstPointer; 00042 00044 itkTypeMacro(ScalarImageToHistogramGenerator, Object) ; 00045 00047 itkNewMacro(Self) ; 00048 00049 typedef TImageType ImageType; 00050 typedef itk::Statistics::ScalarImageToListAdaptor< 00051 ImageType 00052 > AdaptorType; 00053 typedef typename AdaptorType::Pointer AdaptorPointer; 00054 typedef typename ImageType::PixelType PixelType; 00055 typedef typename NumericTraits< PixelType >::RealType RealPixelType; 00056 00057 typedef itk::Statistics::ListSampleToHistogramGenerator< 00058 AdaptorType, 00059 RealPixelType, 00060 DenseFrequencyContainer 00061 > GeneratorType; 00062 00063 typedef typename GeneratorType::Pointer GeneratorPointer; 00064 00065 typedef typename GeneratorType::HistogramType HistogramType; 00066 typedef typename HistogramType::Pointer HistogramPointer; 00067 typedef typename HistogramType::ConstPointer HistogramConstPointer; 00068 00069 public: 00070 00072 void Compute( void ); 00073 00075 void SetInput( const ImageType * ); 00076 00080 const HistogramType * GetOutput() const; 00081 00083 void SetNumberOfBins( unsigned int numberOfBins ); 00084 00086 void SetMarginalScale( double marginalScale ); 00087 00089 void SetHistogramMin( RealPixelType minimumValue ); 00090 00092 void SetHistogramMax( RealPixelType maximumValue ); 00093 00094 protected: 00095 ScalarImageToHistogramGenerator(); 00096 virtual ~ScalarImageToHistogramGenerator() {}; 00097 void PrintSelf(std::ostream& os, Indent indent) const; 00098 00099 00100 private: 00101 00102 AdaptorPointer m_ImageToListAdaptor; 00103 00104 GeneratorPointer m_HistogramGenerator; 00105 00106 ScalarImageToHistogramGenerator(const Self&); //purposely not implemented 00107 void operator=(const Self&); //purposely not implemented 00108 }; 00109 00110 00111 } // end of namespace Statistics 00112 } // end of namespace itk 00113 00114 #ifndef ITK_MANUAL_INSTANTIATION 00115 #include "itkScalarImageToHistogramGenerator.txx" 00116 #endif 00117 00118 #endif 00119