Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImageToHistogramFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageToHistogramFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-08-11 12:41:16 $
00007   Version:   $Revision: 1.3 $
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 __itkImageToHistogramFilter_h
00018 #define __itkImageToHistogramFilter_h
00019 
00020 
00021 #include "itkImageToListSampleAdaptor.h"
00022 #include "itkSampleToHistogramFilter.h"
00023 #include "itkDenseFrequencyContainer2.h"
00024 #include "itkHistogram.h"
00025 #include "itkObject.h"
00026 
00027 
00028 namespace itk {
00029 namespace Statistics {
00030 
00031 
00043 template< class TImageType >
00044 class ITK_EXPORT ImageToHistogramFilter : public ProcessObject
00045 {
00046 public:
00048   typedef ImageToHistogramFilter        Self;
00049   typedef ProcessObject                 Superclass;
00050   typedef SmartPointer<Self>            Pointer;
00051   typedef SmartPointer<const Self>      ConstPointer;
00052 
00054   itkTypeMacro(ImageToHistogramFilter, ProcessObject);
00055 
00057   itkNewMacro(Self);
00058 
00059   typedef TImageType                                        ImageType;
00060   typedef ImageToListSampleAdaptor< ImageType >             AdaptorType;
00061   typedef typename AdaptorType::Pointer                     AdaptorPointer;
00062   typedef typename ImageType::PixelType                     PixelType;
00063   typedef typename NumericTraits< PixelType >::ValueType    ValueType;
00064   typedef typename NumericTraits< ValueType >::RealType     ValueRealType;
00065   typedef DenseFrequencyContainer2                          FrequencyContainerType;
00066 
00067   typedef Histogram< ValueRealType >                        HistogramType;
00068   typedef typename HistogramType::Pointer                   HistogramPointer;
00069   typedef typename HistogramType::ConstPointer              HistogramConstPointer;
00070   typedef typename HistogramType::SizeType                  HistogramSizeType;
00071   typedef typename HistogramType::MeasurementType           HistogramMeasurementType;
00072   typedef typename HistogramType::MeasurementVectorType     HistogramMeasurementVectorType;
00073 
00074   typedef SampleToHistogramFilter< 
00075     AdaptorType, HistogramType >                            GeneratorType;
00076 
00077   typedef typename GeneratorType::Pointer                   GeneratorPointer;
00078 
00079 public:
00080 
00082   void SetInput( const ImageType * );
00083   const ImageType * GetInput() const;
00085 
00089   const HistogramType * GetOutput() const;
00090 
00092   typedef SimpleDataObjectDecorator<
00093     HistogramSizeType > InputHistogramSizeObjectType;
00094 
00096   typedef SimpleDataObjectDecorator<
00097     HistogramMeasurementType > InputHistogramMeasurementObjectType;
00098 
00101   typedef SimpleDataObjectDecorator<
00102     HistogramMeasurementVectorType > InputHistogramMeasurementVectorObjectType;
00103 
00105   typedef SimpleDataObjectDecorator< bool > InputBooleanObjectType;
00106 
00113   itkSetDecoratedInputMacro( HistogramSize, HistogramSizeType, 1 );
00114 
00118   itkSetDecoratedInputMacro( MarginalScale, HistogramMeasurementType, 2 );
00119 
00122   itkSetDecoratedInputMacro( HistogramBinMinimum, HistogramMeasurementVectorType, 3 );
00123   itkSetDecoratedInputMacro( HistogramBinMaximum, HistogramMeasurementVectorType, 4 );
00125 
00129   itkSetDecoratedInputMacro( AutoMinimumMaximum, bool, 5 );
00130 
00131 
00134   virtual void GraftOutput(DataObject *output);
00135 
00136 protected:
00137   ImageToHistogramFilter();
00138   virtual ~ImageToHistogramFilter() {};
00139   void PrintSelf(std::ostream& os, Indent indent) const;
00140 
00142   void GenerateData( void );
00143 
00145   DataObject::Pointer  MakeOutput( unsigned int );
00146 
00147 private:
00148   ImageToHistogramFilter(const Self&); //purposely not implemented
00149   void operator=(const Self&); //purposely not implemented
00150 
00151   AdaptorPointer          m_ImageToListAdaptor;
00152 
00153   GeneratorPointer        m_HistogramGenerator;
00154 
00155 };
00156 
00157 
00158 } // end of namespace Statistics 
00159 } // end of namespace itk 
00160 
00161 #ifndef ITK_MANUAL_INSTANTIATION
00162 #include "itkImageToHistogramFilter.txx"
00163 #endif
00164 
00165 #endif
00166 

Generated at Tue Sep 15 03:30:28 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000