Orfeo Toolbox  3.16
itkRGBGibbsPriorFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkRGBGibbsPriorFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-04-23 03:53:36 $
7  Version: $Revision: 1.31 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkRGBGibbsPriorFilter_h
18 #define __itkRGBGibbsPriorFilter_h
19 
20 #include "vnl/vnl_vector.h"
21 #include "vnl/vnl_matrix.h"
22 
23 #include "itkImageToImageFilter.h"
24 #include "itkImageClassifierBase.h"
25 #include "itkImageRegionIterator.h"
26 #include "itkMRFImageFilter.h"
27 
28 namespace itk
29 {
30 
46 template <class TInputImage, class TClassifiedImage>
47 class ITK_EXPORT RGBGibbsPriorFilter : public MRFImageFilter<TInputImage,
48  TClassifiedImage>
49 {
50 public:
56 
58  itkNewMacro(Self);
59 
62 
65  typedef typename Superclass::InputImageRegionConstIterator InputImageRegionConstIterator;
66  typedef typename Superclass::InputImageRegionIterator InputImageRegionIterator;
67  typedef typename Superclass::LabelledImageRegionIterator LabelledImageRegionIterator;
68  typedef typename Superclass::LabelledImagePixelType LabelledImagePixelType;
69  typedef typename Superclass::IndexValueType IndexValueType;
70 
72  typedef TInputImage InputImageType;
73  typedef typename TInputImage::Pointer InputImagePointer;
74  typedef typename TInputImage::ConstPointer InputImageConstPointer;
75 
77  typedef typename TInputImage::PixelType InputPixelType;
78 
80  typedef typename TClassifiedImage::Pointer TrainingImageType;
81 
84  typedef typename TClassifiedImage::Pointer LabelledImageType;
85 
87  typedef typename TClassifiedImage::IndexType LabelledImageIndexType;
88 
92  typedef unsigned int LabelType;
93 
96 
98  typedef typename TInputImage::PixelType InputImageVecType;
99  typedef typename TInputImage::IndexType IndexType;
100 
102  void SetTrainingImage(TrainingImageType image);
103 
105  void SetLabelledImage(LabelledImageType LabelledImage);
106 
108  LabelledImageType GetLabelledImage()
109  { return m_LabelledImage; }
110 
112  void SetClassifier( typename ClassifierType::Pointer ptrToClassifier );
113 
115  itkSetMacro(NumberOfClasses, unsigned int);
116 
118  itkGetConstMacro(NumberOfClasses, unsigned int);
119 
122  itkSetMacro(MaximumNumberOfIterations, unsigned int);
123 
126  itkGetConstMacro(MaximumNumberOfIterations, unsigned int);
127 
129  itkSetMacro(ClusterSize, unsigned int);
130 
132  itkSetMacro( ObjectLabel, LabelType );
133 
135  itkStaticConstMacro(ImageDimension, unsigned int,
136  TInputImage::ImageDimension);
137 
138  itkSetMacro(StartPoint, IndexType);
139 
140  itkSetMacro(BoundaryGradient, unsigned int);
141 
142  itkSetMacro(ObjectThreshold, double);
143 
145  itkSetMacro(CliqueWeight_1, double);
146  itkGetConstMacro(CliqueWeight_1, double);
147  itkSetMacro(CliqueWeight_2, double);
148  itkGetConstMacro(CliqueWeight_2, double);
149  itkSetMacro(CliqueWeight_3, double);
150  itkGetConstMacro(CliqueWeight_3, double);
151  itkSetMacro(CliqueWeight_4, double);
152  itkGetConstMacro(CliqueWeight_4, double);
153  itkSetMacro(CliqueWeight_5, double);
154  itkGetConstMacro(CliqueWeight_5, double);
155  itkSetMacro(CliqueWeight_6, double);
156  itkGetConstMacro(CliqueWeight_6, double);
157 
158 
161 
162 protected:
165  void PrintSelf(std::ostream& os, Indent indent) const;
166 
167  void Allocate();
169  virtual void MinimizeFunctional();
170  virtual void GenerateData();
171  virtual void ApplyGibbsLabeller();
172  virtual void ApplyGPImageFilter();
173 
174 
175 private:
176  RGBGibbsPriorFilter(const Self&);
177  void operator=(const Self&);
178 
179  typedef typename TInputImage::SizeType InputImageSizeType;
180 
184  unsigned int m_NumberOfClasses;
188 
189  unsigned int m_BoundaryGradient;
198  unsigned int m_Temp;
201  unsigned int m_ImageWidth;
202  unsigned int m_ImageHeight;
203  unsigned int m_ImageDepth;
204  unsigned int m_ClusterSize;
206  unsigned int m_VecDim;
209  unsigned short *m_Region;
210  unsigned short *m_RegionCount;
221  void GibbsTotalEnergy(int i);
222 
224  double GibbsEnergy(unsigned int i, unsigned int k, unsigned int k1);
225 
226  int Sim(int a, int b);
227  unsigned int LabelRegion(int i, int l, int change);
228  void RegionEraser();
229  void GenerateMediumImage();
230  void GreyScalarBoundary(LabelledImageIndexType Index3D);
233 
234 };
235 
236 } // end namespace itk
237 #ifndef ITK_MANUAL_INSTANTIATION
239 #endif
240 #endif

Generated at Sun Feb 3 2013 00:03:27 for Orfeo Toolbox with doxygen 1.8.1.1