#include <itkRGBGibbsPriorFilter.h>
The RGBGibbsPriorFilter applies Gibbs Prior model for the segmentation of MRF images.
The core of the method is based on the minimization of a Gibbsian energy function. This energy function f can be divided into three part:
\[ f = f_1 + f_2 + f_3 \]
where \(f_1\) is related to the object homogeneity, \(f_2\) is related to the boundary smoothness, \(f_3\) is related to the constraint of the observation (or the noise model).
The two force components \(f_1\) and \(f_3\) are minimized by the GradientEnergy method while \(f_2\) is minimized by the GibbsTotalEnergy method.
This filter only works with 3D images.
Definition at line 56 of file itkRGBGibbsPriorFilter.h.
Public Member Functions | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
virtual unsigned int | GetBoundaryGradient () const |
LabelledImageType | GetLabelledImage () |
unsigned int | GetMaximumNumberOfIterations () const override |
const char * | GetNameOfClass () const override |
unsigned int | GetNumberOfClasses () const override |
virtual double | GetObjectThreshold () const |
virtual IndexType | GetStartPoint () const |
virtual void | SetBoundaryGradient (unsigned int _arg) |
void | SetClassifier (typename ClassifierType::Pointer ptrToClassifier) |
void | SetLabelledImage (LabelledImageType image) |
virtual void | SetObjectThreshold (double _arg) |
virtual void | SetStartPoint (IndexType _arg) |
virtual void | SetTrainingImage (TrainingImageType _arg) |
virtual TrainingImageType | GetTrainingImage () const |
void | SetNumberOfClasses (const unsigned int numberOfClasses) override |
void | SetMaximumNumberOfIterations (const unsigned int numberOfIterations) override |
virtual void | SetClusterSize (unsigned int _arg) |
virtual unsigned int | GetClusterSize () const |
virtual void | SetObjectLabel (LabelType _arg) |
virtual LabelType | GetObjectLabel () const |
virtual void | SetCliqueWeight_1 (double _arg) |
virtual double | GetCliqueWeight_1 () const |
virtual void | SetCliqueWeight_2 (double _arg) |
virtual double | GetCliqueWeight_2 () const |
virtual void | SetCliqueWeight_3 (double _arg) |
virtual double | GetCliqueWeight_3 () const |
virtual void | SetCliqueWeight_4 (double _arg) |
virtual double | GetCliqueWeight_4 () const |
virtual void | SetCliqueWeight_5 (double _arg) |
virtual double | GetCliqueWeight_5 () const |
virtual void | SetCliqueWeight_6 (double _arg) |
virtual double | GetCliqueWeight_6 () const |
![]() | |
virtual std::vector< double > | GetMRFNeighborhoodWeight () |
const NeighborhoodRadiusType | GetNeighborhoodRadius () const |
virtual const unsigned int & | GetNumberOfIterations () const |
virtual const MRFStopEnum & | GetStopCondition () const |
void | SetClassifier (typename ClassifierType::Pointer ptrToClassifier) |
virtual void | SetMRFNeighborhoodWeight (std::vector< double > betaMatrix) |
void | SetNeighborhoodRadius (const NeighborhoodRadiusType &) |
void | SetNeighborhoodRadius (const SizeValueType *radiusArray) |
void | SetNeighborhoodRadius (const SizeValueType) |
virtual void | SetErrorTolerance (double _arg) |
virtual double | GetErrorTolerance () const |
virtual void | SetSmoothingFactor (double _arg) |
virtual double | GetSmoothingFactor () const |
![]() | |
const InputImageType * | GetInput () const |
const InputImageType * | GetInput () const |
const InputImageType * | GetInput (unsigned int idx) const |
const InputImageType * | GetInput (unsigned int idx) const |
void | PopBackInput () override |
void | PopBackInput () override |
void | PopFrontInput () override |
void | PopFrontInput () override |
virtual void | PushBackInput (const InputImageType *input) |
virtual void | PushBackInput (const InputImageType *input) |
virtual void | PushFrontInput (const InputImageType *input) |
virtual void | PushFrontInput (const InputImageType *input) |
virtual void | SetInput (const InputImageType *input) |
virtual void | SetInput (const InputImageType *input) |
virtual void | SetInput (unsigned int, const TInputImage *image) |
virtual void | SetInput (unsigned int, const TInputImage *image) |
virtual void | SetCoordinateTolerance (double _arg) |
virtual double | GetCoordinateTolerance () const |
virtual void | SetCoordinateTolerance (double _arg) |
virtual double | GetCoordinateTolerance () const |
virtual void | SetDirectionTolerance (double _arg) |
virtual double | GetDirectionTolerance () const |
virtual void | SetDirectionTolerance (double _arg) |
virtual double | GetDirectionTolerance () const |
![]() | |
OutputImageType * | GetOutput (unsigned int idx) |
OutputImageType * | GetOutput () |
const OutputImageType * | GetOutput () const |
virtual void | GraftOutput (DataObject *graft) |
virtual void | GraftOutput (const DataObjectIdentifierType &key, DataObject *graft) |
virtual void | GraftNthOutput (unsigned int idx, DataObject *graft) |
ProcessObject::DataObjectPointer | MakeOutput (ProcessObject::DataObjectPointerArraySizeType idx) override |
ProcessObject::DataObjectPointer | MakeOutput (const ProcessObject::DataObjectIdentifierType &) override |
![]() | |
virtual void | AbortGenerateDataOff () |
virtual void | AbortGenerateDataOn () |
virtual const bool & | GetAbortGenerateData () const |
DataObjectPointerArray | GetIndexedInputs () |
DataObjectPointerArray | GetIndexedOutputs () |
NameArray | GetInputNames () const |
DataObjectPointerArray | GetInputs () |
MultiThreaderType * | GetMultiThreader () const |
DataObjectPointerArraySizeType | GetNumberOfIndexedInputs () const |
DataObjectPointerArraySizeType | GetNumberOfIndexedOutputs () const |
DataObjectPointerArraySizeType | GetNumberOfInputs () const |
DataObjectPointerArraySizeType | GetNumberOfOutputs () const |
virtual DataObjectPointerArraySizeType | GetNumberOfValidRequiredInputs () const |
NameArray | GetOutputNames () const |
DataObjectPointerArray | GetOutputs () |
virtual float | GetProgress () const |
NameArray | GetRequiredInputNames () const |
bool | HasInput (const DataObjectIdentifierType &key) const |
bool | HasOutput (const DataObjectIdentifierType &key) const |
void | IncrementProgress (float increment) |
virtual void | PrepareOutputs () |
virtual void | PropagateRequestedRegion (DataObject *output) |
virtual void | ResetPipeline () |
virtual void | SetAbortGenerateData (bool _arg) |
void | SetMultiThreader (MultiThreaderType *threader) |
virtual void | Update () |
virtual void | UpdateLargestPossibleRegion () |
virtual void | UpdateOutputData (DataObject *output) |
virtual void | UpdateOutputInformation () |
void | UpdateProgress (float progress) |
virtual void | SetReleaseDataFlag (bool val) |
virtual bool | GetReleaseDataFlag () const |
void | ReleaseDataFlagOn () |
void | ReleaseDataFlagOff () |
virtual void | SetReleaseDataBeforeUpdateFlag (bool _arg) |
virtual const bool & | GetReleaseDataBeforeUpdateFlag () const |
virtual void | ReleaseDataBeforeUpdateFlagOn () |
virtual void | ReleaseDataBeforeUpdateFlagOff () |
virtual void | SetNumberOfWorkUnits (ThreadIdType _arg) |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
![]() | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
![]() | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = TInputImage::ImageDimension |
![]() | |
static constexpr unsigned int | ClassifiedImageDimension = TClassifiedImage::ImageDimension |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
![]() | |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | OutputImageDimension |
static constexpr unsigned int | OutputImageDimension |
![]() | |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Private Types | |
using | InputImageSizeType = typename TInputImage::SizeType |
Private Member Functions | |
void | GenerateMediumImage () |
double | GibbsEnergy (unsigned int i, unsigned int k, unsigned int k1) |
void | GibbsTotalEnergy (int i) |
void | GreyScalarBoundary (LabelledImageIndexType Index3D) |
unsigned int | LabelRegion (int i, int l, int change) |
void | RegionEraser () |
int | Sim (int a, int b) |
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::ClassifiedImageType = TClassifiedImage |
Type definitions for the training image.
Definition at line 90 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::ClassifierType = ImageClassifierBase<TInputImage, TClassifiedImage> |
Type definitions for classifier to be used for the MRF labeling.
Definition at line 106 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 65 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::IndexType = typename TInputImage::IndexType |
Definition at line 110 of file itkRGBGibbsPriorFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::IndexValueType |
Definition at line 205 of file itkMRFImageFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::InputImageConstPointer = typename TInputImage::ConstPointer |
Definition at line 84 of file itkRGBGibbsPriorFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::InputImagePixelType |
Type definition for the input image pixel type.
Definition at line 173 of file itkMRFImageFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::InputImagePointer = typename TInputImage::Pointer |
Definition at line 83 of file itkRGBGibbsPriorFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::InputImageRegionConstIterator |
Definition at line 180 of file itkMRFImageFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::InputImageRegionIterator |
Type definition for the input image region iterator
Definition at line 179 of file itkMRFImageFilter.h.
|
private |
Definition at line 242 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::InputImageType = TInputImage |
A smart pointer to the input image type.
Definition at line 82 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::InputImageVecType = typename TInputImage::PixelType |
Input pixel type.
Definition at line 109 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::InputPixelType = typename TInputImage::PixelType |
Type definition for the input image pixel type.
Definition at line 87 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::LabelledImageIndexType = typename TClassifiedImage::IndexType |
Type definition for the classified image index type.
Definition at line 98 of file itkRGBGibbsPriorFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::LabelledImagePixelType |
Type definitions for the classified image pixel type. It has to be the same type as the training image.
Definition at line 197 of file itkMRFImageFilter.h.
using itk::MRFImageFilter< TInputImage, TClassifiedImage >::LabelledImageRegionIterator |
Type definition for the input image region iterator
Definition at line 211 of file itkMRFImageFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::LabelledImageType = typename TClassifiedImage::Pointer |
Type definitions for the labelled image. Derived from the training image.
Definition at line 95 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::LabelType = unsigned int |
Type used as identifier for the labels.
Definition at line 103 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::MatrixType = vnl_matrix<double> |
Type of matrix to use.
Definition at line 212 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::Pointer = SmartPointer<Self> |
Definition at line 64 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::Self = RGBGibbsPriorFilter |
Standard "Self" type alias.
Definition at line 62 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::Superclass = MRFImageFilter<TInputImage, TClassifiedImage> |
Definition at line 63 of file itkRGBGibbsPriorFilter.h.
using itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::TrainingImageType = typename TClassifiedImage::Pointer |
Definition at line 91 of file itkRGBGibbsPriorFilter.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotecteddefault |
|
protected |
Allocate memory for classified image pixel status.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
|
overrideprotectedvirtual |
A version of GenerateData() specific for image processing filters. This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling DynamicThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter can be threaded, it should NOT provide a GenerateData() method but should provide a DynamicThreadedGenerateData() instead.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
|
private |
Create the intermediate image.
|
virtual |
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the threshold for the object size.
|
inline |
Get the labelled image.
Definition at line 123 of file itkRGBGibbsPriorFilter.h.
References m_LabelledImage.
|
inlineoverridevirtual |
Get the number of iterations of the Iterated Conditional Mode (ICM) algorithm.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
Definition at line 169 of file itkRGBGibbsPriorFilter.h.
References m_MaximumNumberOfIterations.
|
overridevirtual |
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
References RGBGibbsPriorFilter().
|
inlineoverridevirtual |
Get the number of classes.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
Definition at line 147 of file itkRGBGibbsPriorFilter.h.
References m_NumberOfClasses.
|
virtual |
Set/Get the label for the object region.
|
virtual |
|
virtual |
|
virtual |
Set/Get the image required for training type classifiers.
|
private |
Calculate the energy in each cluster.
|
private |
Minimize the local characteristic \(f_2\) term in the energy function. Calculates \(H_2\).
|
private |
Smooth the image in piecewise fashion. Calculates \(H_1\).
|
private |
Label a region.
|
overrideprotectedvirtual |
Minimize the functional to be used.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
|
private |
Erase small regions. Removes the tiny bias inside the object region.
|
virtual |
void itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::SetClassifier | ( | typename ClassifierType::Pointer | ptrToClassifier | ) |
Set the classifier.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the value for clique weights.
|
virtual |
Set/Get the threshold for the object size.
void itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >::SetLabelledImage | ( | LabelledImageType | image | ) |
Set the labelled image.
|
inlineoverridevirtual |
Set/Get the number of iteration of the Iterated Conditional Mode (ICM) algorithm. A default value is set at 50 iterations.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
Definition at line 155 of file itkRGBGibbsPriorFilter.h.
References m_MaximumNumberOfIterations, and itk::Object::Modified().
|
inlineoverridevirtual |
Set the number of classes.
Reimplemented from itk::MRFImageFilter< TInputImage, TClassifiedImage >.
Definition at line 134 of file itkRGBGibbsPriorFilter.h.
References m_NumberOfClasses, and itk::Object::Modified().
|
virtual |
Set/Get the label for the object region.
|
virtual |
|
virtual |
|
virtual |
Set/Get the image required for training type classifiers.
|
private |
Check if the values are identical.
|
staticconstexpr |
Extract the input image dimension.
Definition at line 185 of file itkRGBGibbsPriorFilter.h.
|
private |
Threshold for the existence of a boundary.
Definition at line 262 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for \(H_1\).
Definition at line 265 of file itkRGBGibbsPriorFilter.h.
|
private |
Definition at line 259 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for cliques that v/h smooth boundary.
Definition at line 318 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for clique that has an intermediate smooth boundary.
Definition at line 321 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for clique that has a diagonal smooth boundary.
Definition at line 324 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for clique consists only object pixels.
Definition at line 327 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for clique consists only background pixels.
Definition at line 330 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for other cliques.
Definition at line 333 of file itkRGBGibbsPriorFilter.h.
|
private |
Region sizes smaller than this threshold value will be erased.
Definition at line 298 of file itkRGBGibbsPriorFilter.h.
|
private |
Weight for \(H_2\).
Definition at line 268 of file itkRGBGibbsPriorFilter.h.
|
private |
Image depth.
Definition at line 295 of file itkRGBGibbsPriorFilter.h.
|
private |
Image height.
Definition at line 292 of file itkRGBGibbsPriorFilter.h.
|
private |
Image width.
Definition at line 289 of file itkRGBGibbsPriorFilter.h.
|
private |
Input.
Definition at line 245 of file itkRGBGibbsPriorFilter.h.
|
private |
|
private |
Array to store the state of each pixel.
Definition at line 277 of file itkRGBGibbsPriorFilter.h.
|
private |
Point giving lowest value of \(H_1\) in neighborhood.
Definition at line 307 of file itkRGBGibbsPriorFilter.h.
|
private |
Maximum number of iterations.
Definition at line 257 of file itkRGBGibbsPriorFilter.h.
Referenced by GetMaximumNumberOfIterations(), and SetMaximumNumberOfIterations().
|
private |
Intermediate result image.
Definition at line 280 of file itkRGBGibbsPriorFilter.h.
|
private |
Number of classes that need to be classified.
Definition at line 254 of file itkRGBGibbsPriorFilter.h.
Referenced by GetNumberOfClasses(), and SetNumberOfClasses().
|
private |
Label for object region.
Definition at line 301 of file itkRGBGibbsPriorFilter.h.
|
private |
Definition at line 366 of file itkRGBGibbsPriorFilter.h.
|
private |
Number of SA iterations.
Definition at line 274 of file itkRGBGibbsPriorFilter.h.
|
private |
Used for erasing regions.
Definition at line 310 of file itkRGBGibbsPriorFilter.h.
|
private |
Used for erasing regions.
Definition at line 313 of file itkRGBGibbsPriorFilter.h.
|
private |
Seed.
Definition at line 286 of file itkRGBGibbsPriorFilter.h.
|
private |
Start region of the object.
Definition at line 271 of file itkRGBGibbsPriorFilter.h.
|
private |
Used by the SA algorithm.
Definition at line 283 of file itkRGBGibbsPriorFilter.h.
|
private |
Image to train the filter.
Definition at line 248 of file itkRGBGibbsPriorFilter.h.
|
private |
Number of channels in the image.
Definition at line 304 of file itkRGBGibbsPriorFilter.h.