00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageToHistogramGenerator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/05/16 18:42:42 $ 00007 Version: $Revision: 1.4 $ 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 __itkImageToHistogramGenerator_h 00018 #define __itkImageToHistogramGenerator_h 00019 00020 00021 #include "itkImageToListAdaptor.h" 00022 #include "itkListSampleToHistogramGenerator.h" 00023 #include "itkObject.h" 00024 00025 00026 namespace itk { 00027 namespace Statistics { 00028 00039 template< class TImageType > 00040 class ImageToHistogramGenerator : public Object 00041 { 00042 public: 00044 typedef ImageToHistogramGenerator Self ; 00045 typedef Object Superclass; 00046 typedef SmartPointer<Self> Pointer; 00047 typedef SmartPointer<const Self> ConstPointer; 00048 00050 itkTypeMacro(ImageToHistogramGenerator, Object) ; 00051 00053 itkNewMacro(Self) ; 00054 00055 typedef TImageType ImageType; 00056 typedef itk::Statistics::ImageToListAdaptor< 00057 ImageType 00058 > AdaptorType; 00059 typedef typename AdaptorType::Pointer AdaptorPointer; 00060 typedef typename ImageType::PixelType PixelType; 00061 typedef typename PixelType::ValueType ValueType; 00062 typedef typename NumericTraits< ValueType >::RealType ValueRealType; 00063 00064 typedef itk::Statistics::ListSampleToHistogramGenerator< 00065 AdaptorType, 00066 ValueRealType 00067 > GeneratorType; 00068 00069 typedef typename GeneratorType::Pointer GeneratorPointer; 00070 00071 typedef typename GeneratorType::HistogramType HistogramType; 00072 typedef typename HistogramType::Pointer HistogramPointer; 00073 typedef typename HistogramType::ConstPointer HistogramConstPointer; 00074 typedef typename HistogramType::SizeType SizeType; 00075 typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; 00076 00077 public: 00078 00080 void Compute( void ); 00081 00083 void SetInput( const ImageType * ); 00084 00088 const HistogramType * GetOutput() const; 00089 00091 void SetNumberOfBins( const SizeType & size ); 00092 00094 void SetMarginalScale( double marginalScale ); 00095 void SetHistogramMin(const MeasurementVectorType & histogramMin); 00096 void SetHistogramMax(const MeasurementVectorType & histogramMax); 00097 void SetAutoMinMax(bool autoMinMax); 00098 00099 protected: 00100 ImageToHistogramGenerator(); 00101 virtual ~ImageToHistogramGenerator() {}; 00102 void PrintSelf(std::ostream& os, Indent indent) const; 00103 00104 00105 private: 00106 00107 AdaptorPointer m_ImageToListAdaptor; 00108 00109 GeneratorPointer m_HistogramGenerator; 00110 00111 }; 00112 00113 00114 } // end of namespace Statistics 00115 } // end of namespace itk 00116 00117 #ifndef ITK_MANUAL_INSTANTIATION 00118 #include "itkImageToHistogramGenerator.txx" 00119 #endif 00120 00121 #endif