00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkBayesianClassifierImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/03/14 21:47:51 $ 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 __itkBayesianClassifierImageFilter_h 00018 #define __itkBayesianClassifierImageFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkMaximumRatioDecisionRule.h" 00022 #include "itkGaussianDensityFunction.h" 00023 00024 namespace itk 00025 { 00026 00044 template <class TInputImage, class TOutputImage> 00045 class ITK_EXPORT BayesianClassifierImageFilter : 00046 public 00047 ImageToImageFilter<TInputImage,TOutputImage> 00048 { 00049 public: 00051 typedef BayesianClassifierImageFilter Self; 00052 typedef ImageToImageFilter<TInputImage,TOutputImage 00053 > Superclass; 00054 typedef SmartPointer<Self> Pointer; 00055 typedef SmartPointer<const Self> ConstPointer; 00056 00058 itkNewMacro(Self); 00059 00061 itkTypeMacro(BayesianClassifierImageFilter, ImageToImageFilter); 00062 00064 typedef typename TInputImage::PixelType InputPixelType; 00065 typedef typename TOutputImage::PixelType OutputPixelType; 00066 00068 typedef typename Superclass::InputImageType InputImageType; 00069 typedef typename Superclass::OutputImageType OutputImageType; 00070 00072 typedef InputPixelType MeasurementVectorType; 00073 00075 typedef Statistics::GaussianDensityFunction< MeasurementVectorType > 00076 MembershipFunctionType; 00077 typedef typename MembershipFunctionType::ConstPointer MembershipFunctionConstPointer; 00078 00080 typedef std::vector< MembershipFunctionConstPointer > MembershipFunctionContainer; 00081 00083 typedef MaximumRatioDecisionRule DecisionRuleType; 00084 00085 00087 void AddMembershipFunction( const MembershipFunctionType * newFunction ); 00088 00089 00090 protected: 00091 BayesianClassifierImageFilter(); 00092 virtual ~BayesianClassifierImageFilter() {} 00093 void PrintSelf(std::ostream& os, Indent indent) const; 00094 00096 virtual void GenerateData(); 00097 00098 private: 00099 BayesianClassifierImageFilter(const Self&); //purposely not implemented 00100 void operator=(const Self&); //purposely not implemented 00101 00102 MembershipFunctionContainer m_MembershipFunctions; 00103 }; 00104 00105 } // end namespace itk 00106 00107 #ifndef ITK_MANUAL_INSTANTIATION 00108 #include "itkBayesianClassifierImageFilter.txx" 00109 #endif 00110 00111 #endif