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

itkStatisticsLabelMapFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkStatisticsLabelMapFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-08-08 01:21:23 $
00007   Version:   $Revision: 1.2 $
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 __itkStatisticsLabelMapFilter_h
00018 #define __itkStatisticsLabelMapFilter_h
00019 
00020 #include "itkShapeLabelMapFilter.h"
00021 
00022 namespace itk {
00037 template<class TImage, class TFeatureImage>
00038 class ITK_EXPORT StatisticsLabelMapFilter : 
00039     public ShapeLabelMapFilter<TImage, Image< typename TImage::PixelType, ::itk::GetImageDimension<TImage>::ImageDimension> >
00040 {
00041 public:
00043   typedef StatisticsLabelMapFilter    Self;
00044   typedef ShapeLabelMapFilter<TImage> Superclass;
00045   typedef SmartPointer<Self>          Pointer;
00046   typedef SmartPointer<const Self>    ConstPointer;
00047 
00049   typedef TImage                               ImageType;
00050   typedef typename ImageType::Pointer          ImagePointer;
00051   typedef typename ImageType::ConstPointer     ImageConstPointer;
00052   typedef typename ImageType::PixelType        PixelType;
00053   typedef typename ImageType::IndexType        IndexType;
00054   typedef typename ImageType::PointType        PointType;
00055   typedef typename ImageType::LabelObjectType  LabelObjectType;
00056   typedef typename LabelObjectType::MatrixType MatrixType;
00057   typedef typename LabelObjectType::VectorType VectorType;
00058 
00059   typedef TFeatureImage                              FeatureImageType;
00060   typedef typename FeatureImageType::Pointer         FeatureImagePointer;
00061   typedef typename FeatureImageType::ConstPointer    FeatureImageConstPointer;
00062   typedef typename FeatureImageType::PixelType       FeatureImagePixelType;
00063   
00065   itkStaticConstMacro(ImageDimension, unsigned int,
00066                       TImage::ImageDimension);
00067 
00069   itkNewMacro(Self);  
00070 
00072   itkTypeMacro(StatisticsLabelMapFilter, 
00073                ShapeLabelMapFilter);
00074 
00075 #ifdef ITK_USE_CONCEPT_CHECKING
00076 
00077 /*  itkConceptMacro(InputEqualityComparableCheck,
00078     (Concept::EqualityComparable<InputImagePixelType>));
00079   itkConceptMacro(IntConvertibleToInputCheck,
00080     (Concept::Convertible<int, InputImagePixelType>));
00081   itkConceptMacro(InputOStreamWritableCheck,
00082     (Concept::OStreamWritable<InputImagePixelType>));*/
00083 
00085 #endif
00086 
00088   void SetFeatureImage(const TFeatureImage *input)
00089     {
00090     // Process object is not const-correct so the const casting is required.
00091     this->SetNthInput( 1, const_cast<TFeatureImage *>(input) );
00092     }
00093 
00095   FeatureImageType * GetFeatureImage()
00096     {
00097     return static_cast<FeatureImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
00098     }
00099 
00101   void SetInput1(TImage *input)
00102     {
00103     this->SetInput( input );
00104     }
00105 
00107   void SetInput2(const TFeatureImage *input)
00108     {
00109     this->SetFeatureImage( input );
00110     }
00111 
00118   itkSetMacro(ComputeHistogram, bool);
00119   itkGetConstReferenceMacro(ComputeHistogram, bool);
00120   itkBooleanMacro(ComputeHistogram);
00122 
00128   itkSetMacro(NumberOfBins, unsigned int);
00129   itkGetConstReferenceMacro(NumberOfBins, unsigned int);
00131 
00132 
00133 protected:
00134   StatisticsLabelMapFilter();
00135   ~StatisticsLabelMapFilter() {};
00136 
00137   virtual void ThreadedProcessLabelObject( LabelObjectType * labelObject );
00138   
00139   virtual void BeforeThreadedGenerateData();
00140   
00141   void PrintSelf(std::ostream& os, Indent indent) const;
00142 
00143 private:
00144   StatisticsLabelMapFilter(const Self&); //purposely not implemented
00145   void operator=(const Self&); //purposely not implemented
00146 
00147   FeatureImagePixelType m_Minimum;
00148   FeatureImagePixelType m_Maximum;
00149   unsigned int          m_NumberOfBins;
00150   bool                  m_ComputeHistogram;
00151 
00152 }; // end of class
00153 
00154 } // end namespace itk
00155   
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkStatisticsLabelMapFilter.txx"
00158 #endif
00159 
00160 #endif
00161 

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