itkRGBGibbsPriorFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkRGBGibbsPriorFilter_h
00018 #define __itkRGBGibbsPriorFilter_h
00019
00020 #include "vnl/vnl_vector.h"
00021 #include "vnl/vnl_matrix.h"
00022
00023 #include "itkImageToImageFilter.h"
00024 #include "itkImageClassifierBase.h"
00025 #include "itkImageRegionIterator.h"
00026 #include "itkMRFImageFilter.h"
00027
00028 namespace itk
00029 {
00030
00046 template <class TInputImage, class TClassifiedImage>
00047 class ITK_EXPORT RGBGibbsPriorFilter : public MRFImageFilter<TInputImage,
00048 TClassifiedImage>
00049 {
00050 public:
00052 typedef RGBGibbsPriorFilter Self;
00053 typedef MRFImageFilter<TInputImage, TClassifiedImage> Superclass;
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkNewMacro(Self);
00059
00061 itkTypeMacro(RGBGibbsPriorFilter,MRFImageFilter);
00062
00064 typedef typename Superclass::InputImagePixelType InputImagePixelType;
00065 typedef typename Superclass::InputImageRegionConstIterator InputImageRegionConstIterator;
00066 typedef typename Superclass::InputImageRegionIterator InputImageRegionIterator;
00067 typedef typename Superclass::LabelledImageRegionIterator LabelledImageRegionIterator;
00068 typedef typename Superclass::LabelledImagePixelType LabelledImagePixelType;
00069 typedef typename Superclass::IndexValueType IndexValueType;
00070
00072 typedef TInputImage InputImageType;
00073 typedef typename TInputImage::Pointer InputImagePointer;
00074 typedef typename TInputImage::ConstPointer InputImageConstPointer;
00075
00077 typedef typename TInputImage::PixelType InputPixelType;
00078
00080 typedef typename TClassifiedImage::Pointer TrainingImageType;
00081
00084 typedef typename TClassifiedImage::Pointer LabelledImageType;
00085
00087 typedef typename TClassifiedImage::IndexType LabelledImageIndexType;
00088
00092 typedef unsigned int LabelType;
00093
00095 typedef ImageClassifierBase<TInputImage,TClassifiedImage> ClassifierType;
00096
00098 typedef typename TInputImage::PixelType InputImageVecType;
00099 typedef typename TInputImage::IndexType IndexType;
00100
00102 void SetTrainingImage(TrainingImageType image);
00103
00105 void SetLabelledImage(LabelledImageType LabelledImage);
00106
00108 LabelledImageType GetLabelledImage()
00109 { return m_LabelledImage; }
00110
00112 void SetClassifier( typename ClassifierType::Pointer ptrToClassifier );
00113
00115 itkSetMacro(NumberOfClasses, unsigned int);
00116
00118 itkGetConstMacro(NumberOfClasses, unsigned int);
00119
00122 itkSetMacro(MaximumNumberOfIterations, unsigned int);
00123
00126 itkGetConstMacro(MaximumNumberOfIterations, unsigned int);
00127
00129 itkSetMacro(ClusterSize, unsigned int);
00130
00132 itkSetMacro( ObjectLabel, LabelType );
00133
00135 itkStaticConstMacro(ImageDimension, unsigned int,
00136 TInputImage::ImageDimension);
00137
00138 itkSetMacro(StartPoint, IndexType);
00139
00140 itkSetMacro(BoundaryGradient, unsigned int);
00141
00142 itkSetMacro(ObjectThreshold, double);
00143
00145 itkSetMacro(CliqueWeight_1, double);
00146 itkGetConstMacro(CliqueWeight_1, double);
00147 itkSetMacro(CliqueWeight_2, double);
00148 itkGetConstMacro(CliqueWeight_2, double);
00149 itkSetMacro(CliqueWeight_3, double);
00150 itkGetConstMacro(CliqueWeight_3, double);
00151 itkSetMacro(CliqueWeight_4, double);
00152 itkGetConstMacro(CliqueWeight_4, double);
00153 itkSetMacro(CliqueWeight_5, double);
00154 itkGetConstMacro(CliqueWeight_5, double);
00155 itkSetMacro(CliqueWeight_6, double);
00156 itkGetConstMacro(CliqueWeight_6, double);
00158
00159
00161 typedef vnl_matrix<double> MatrixType;
00162
00163 protected:
00164 RGBGibbsPriorFilter();
00165 ~RGBGibbsPriorFilter();
00166 void PrintSelf(std::ostream& os, Indent indent) const;
00167
00170 virtual void MinimizeFunctional();
00171 virtual void GenerateData();
00172 virtual void ApplyGibbsLabeller();
00173 virtual void ApplyGPImageFilter();
00174
00175
00176 private:
00177 RGBGibbsPriorFilter(const Self&);
00178 void operator=(const Self&);
00179
00180 typedef typename TInputImage::SizeType InputImageSizeType;
00181
00192 typename ClassifierType::Pointer m_ClassifierPtr;
00193
00213 unsigned int m_ImageHeight;
00214 unsigned int m_ImageDepth;
00215
00243 void GibbsTotalEnergy(int i);
00244
00246 double GibbsEnergy(unsigned int i, unsigned int k, unsigned int k1);
00247
00258 double m_ObjectThreshold;
00259
00260 };
00261
00262 }
00263 #ifndef ITK_MANUAL_INSTANTIATION
00264 #include "itkRGBGibbsPriorFilter.txx"
00265 #endif
00266 #endif
00267