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

itkBayesianClassifierInitializationImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBayesianClassifierInitializationImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/04/20 13:36:35 $
00007   Version:   $Revision: 1.6 $
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 __itkBayesianClassifierInitializationImageFilter_h
00018 #define __itkBayesianClassifierInitializationImageFilter_h
00019 
00020 #include "itkVectorImage.h"
00021 #include "itkVectorContainer.h"
00022 #include "itkImageToImageFilter.h"
00023 #include "itkImageRegionIterator.h"
00024 #include "itkImageRegionConstIterator.h"
00025 #include "itkDensityFunction.h"
00026 
00027 namespace itk
00028 {
00029   
00073 template< class TInputImage, class TProbabilityPrecisionType=float >
00074 class ITK_EXPORT BayesianClassifierInitializationImageFilter :
00075     public
00076 ImageToImageFilter<TInputImage, VectorImage< TProbabilityPrecisionType, 
00077                   ::itk::GetImageDimension< TInputImage >::ImageDimension > >
00078 {
00079 public:
00081   typedef BayesianClassifierInitializationImageFilter  Self;
00082   typedef TInputImage                                  InputImageType;
00083   typedef TProbabilityPrecisionType                    ProbabilityPrecisionType;
00084 
00086   itkStaticConstMacro( Dimension, unsigned int, 
00087                      ::itk::GetImageDimension< InputImageType >::ImageDimension );
00088 
00089   typedef VectorImage< ProbabilityPrecisionType, 
00090           itkGetStaticConstMacro(Dimension) >                   OutputImageType;
00091   typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass;
00092   typedef SmartPointer<Self>                                    Pointer;
00093   typedef SmartPointer<const Self>                              ConstPointer;
00094 
00096   itkNewMacro(Self);
00097 
00099   itkTypeMacro(BayesianClassifierInitializationImageFilter, ImageToImageFilter);
00100 
00102   typedef ImageRegionConstIterator< InputImageType > InputImageIteratorType;
00103 
00105   typedef typename InputImageType::PixelType  InputPixelType;
00106   typedef typename OutputImageType::PixelType OutputPixelType;
00107 
00111   typedef VectorImage< ProbabilityPrecisionType, 
00112           itkGetStaticConstMacro(Dimension) >             MembershipImageType;
00113   typedef typename MembershipImageType::PixelType         MembershipPixelType;
00114   typedef typename MembershipImageType::Pointer           MembershipImagePointer;
00115   typedef ImageRegionIterator< MembershipImageType >      MembershipImageIteratorType;
00116 
00118   typedef Vector< InputPixelType, 1 >                     MeasurementVectorType;
00119 
00121   typedef Statistics::DensityFunction< MeasurementVectorType >
00122                                                         MembershipFunctionType;
00123   typedef typename MembershipFunctionType::Pointer      MembershipFunctionPointer;
00124 
00126   typedef VectorContainer< unsigned int, 
00127        MembershipFunctionPointer >  MembershipFunctionContainerType;
00128   typedef typename MembershipFunctionContainerType::Pointer
00129                                     MembershipFunctionContainerPointer;
00130 
00136   virtual void SetMembershipFunctions( MembershipFunctionContainerType 
00137                                                 * densityFunctionContainer );
00138   itkGetObjectMacro(  MembershipFunctionContainer, MembershipFunctionContainerType );
00140 
00142   itkSetMacro( NumberOfClasses, unsigned int );
00143   itkGetMacro( NumberOfClasses, unsigned int );
00145 
00146   virtual void GenerateOutputInformation(); 
00147 
00148 #ifdef ITK_USE_CONCEPT_CHECKING
00149 
00150   itkConceptMacro(InputMultiplyOperatorCheck,
00151     (Concept::MultiplyOperator<InputPixelType>));
00152   itkConceptMacro(DoubleConvertibleToProbabilityCheck,
00153     (Concept::Convertible<double, TProbabilityPrecisionType>));
00154   itkConceptMacro(InputHasNumericTraitsCheck,
00155     (Concept::HasNumericTraits<InputPixelType>));
00156   itkConceptMacro(ProbabilityHasNumericTraitsCheck,
00157     (Concept::HasNumericTraits<TProbabilityPrecisionType>));
00158   itkConceptMacro(DoublePlusInputCheck,
00159     (Concept::AdditiveOperators<double, InputPixelType>));
00160 
00162 #endif
00163 
00164 protected:
00165   BayesianClassifierInitializationImageFilter();
00166   virtual ~BayesianClassifierInitializationImageFilter() {}
00167   void PrintSelf(std::ostream& os, Indent indent) const;
00168 
00174   virtual void InitializeMembershipFunctions();
00175 
00177   virtual void GenerateData();
00178 
00179 private:
00180   BayesianClassifierInitializationImageFilter(const Self&); //purposely not implemented
00181   void operator=(const Self&); //purposely not implemented
00182 
00183   bool                      m_UserSuppliesMembershipFunctions;
00184   unsigned int              m_NumberOfClasses;
00185 
00186   typename MembershipFunctionContainerType::Pointer m_MembershipFunctionContainer;
00187 };
00188 
00189 } // end namespace itk
00190 
00191 #ifndef ITK_MANUAL_INSTANTIATION
00192 #include "itkBayesianClassifierInitializationImageFilter.txx"
00193 #endif
00194 
00195 #endif
00196 

Generated at Sun Sep 23 11:53:27 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000