#include <itkMRFImageFilter.h>
Inheritance diagram for itk::MRFImageFilter< TInputImage, TClassifiedImage >:
This object classifies pixels based on a Markov Random Field (MRF) model.This implementation uses the maximum a posteriori (MAP) estimates for modeling the MRF. The object traverses the data set and uses the model generated by the Mahalanobis distance classifier to gets the the distance between each pixel in the data set to a set of known classes, updates the distances by evaluating the influence of its neighboring pixels (based on a MRF model) and finally, classifies each pixel to the class which has the minimum distance to that pixel (taking the neighborhood influence under consideration). DoNeighborhoodOperation is the function that can be modified to achieve different falvors of MRF filters in derived classes.
The a classified initial labeled image is needed. It is important that the number of expected classes be set before calling the classifier. In our case we have used the ImageClassifer using a Gaussian model to generate the initial labels. This classifier requires the user to ensure that an appropriate membership functions be provided. See the documentation of the image classifier class for more information.
The influence of a neighborhood on a given pixel's classification (the MRF term) is computed by calculating a weighted sum of number of class labels in a three dimensional neighborhood. The basic idea of this neighborhood influence is that if a large number of neighbors of a pixel are of one class, then the current pixel is likely to be of the same class.
The dimensions of the neighborhood is same as the input image dimension and values of the weighting parameters are either specified by the user through the beta matrix parameter. The default weighting table is generated during object construction. The following table shows an example of a 3x3x3 neighborhood and the weighting values used. A 3 x 3 x 3 kernel is used where each value is a nonnegative parameter, which encourages neighbors to be of the same class. In this example, the influence of the pixels in the same slice is assigned a weight 1.7, the influence of the pixels in the same location in the previous and next slice is assigned a weight 1.5, while a weight 1.3 is assigned to the influence of the north, south, east, west and diagonal pixels in the previous and next slices.
The user needs to set the neighborhood size using the SetNeighborhoodRadius functions. The details on the semantics of a neighborhood can be found in the documentation associated with the itkNeighborhood and related objects. NOTE: The size of the neighborhood must match with the size of the neighborhood weighting parameters set by the user.
For minimization of the MRF labeling function the MinimizeFunctional virtual method is called. For our current implementation we use the the iterated conditional modes (ICM) algorithm described by Besag in the paper ``On the Statistical Analysis of Dirty Pictures'' in J. Royal Stat. Soc. B, Vol. 48, 1986.
In each iteration, the algorithm visits each pixel in turn and determines whether to update its classification by computing the influence of the classification of the pixel's neighbors and of the intensity data. On each iteration after the first, we reexamine the classification of a pixel only if the classification of some of its neighbors has changed in the previous iteration. The pixels' classification is updated using a synchronous scheme (iteration by iteration) until the error reaches less than the threshold or the number of iteration exceed the maximum set number of iterations. Note: The current implementation supports betaMatrix default weight for two and three dimensional images only. The default for higher dimension is set to unity. This should be over ridded by custom weights after filter initialization.
Classifier
Definition at line 131 of file itkMRFImageFilter.h.
|
Type definitions for classifier to be used for the MRF lavbelling. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 201 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 139 of file itkMRFImageFilter.h. |
|
Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 187 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 151 of file itkMRFImageFilter.h. |
|
Definition at line 223 of file itkMRFImageFilter.h. |
|
Definition at line 220 of file itkMRFImageFilter.h. |
|
Definition at line 217 of file itkMRFImageFilter.h. |
|
Input image neighborhood iterator and kernel size typedef Definition at line 211 of file itkMRFImageFilter.h. |
|
Definition at line 214 of file itkMRFImageFilter.h. |
|
Type definition for the input image pixel type. Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 154 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 150 of file itkMRFImageFilter.h. |
|
Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 161 of file itkMRFImageFilter.h. |
|
Type definition for the input image region iterator Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 160 of file itkMRFImageFilter.h. |
|
Type definition for the input image region type. Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Definition at line 157 of file itkMRFImageFilter.h. |
|
Type definition for the input image. Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 149 of file itkMRFImageFilter.h. |
|
Definition at line 239 of file itkMRFImageFilter.h. |
|
Definition at line 236 of file itkMRFImageFilter.h. |
|
Definition at line 233 of file itkMRFImageFilter.h. |
|
Type definition for the classified image index type. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 186 of file itkMRFImageFilter.h. |
|
Labelled image neighborhood interator typedef Definition at line 227 of file itkMRFImageFilter.h. |
|
Definition at line 230 of file itkMRFImageFilter.h. |
|
Type definition for the classified image offset type. Definition at line 190 of file itkMRFImageFilter.h. |
|
Type definitions for the classified image pixel type. It has to be the same type as the training image. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 179 of file itkMRFImageFilter.h. |
|
Type definitions for the labelled image. It is derived from the training image. Definition at line 175 of file itkMRFImageFilter.h. |
|
Type definition for the input image region iterator Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 194 of file itkMRFImageFilter.h. |
|
Type definitions for the classified image pixel type. It has to be the same type as the training image. Definition at line 183 of file itkMRFImageFilter.h. |
|
Definition at line 334 of file itkMRFImageFilter.h. |
|
Labelled status image neighborhood interator typedef Definition at line 338 of file itkMRFImageFilter.h. |
|
Definition at line 332 of file itkMRFImageFilter.h. |
|
Definition at line 329 of file itkMRFImageFilter.h. |
|
Definition at line 330 of file itkMRFImageFilter.h. |
|
Definition at line 331 of file itkMRFImageFilter.h. |
|
Radius typedef support. Definition at line 207 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageSource< TClassifiedImage >. Definition at line 140 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 138 of file itkMRFImageFilter.h. |
|
Standard class typedefs. Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 136 of file itkMRFImageFilter.h. |
|
Size and value typedef support. Definition at line 204 of file itkMRFImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. Definition at line 137 of file itkMRFImageFilter.h. |
|
Type definitions for the training image pixel type. Definition at line 171 of file itkMRFImageFilter.h. |
|
Type definitions for the training image. Definition at line 168 of file itkMRFImageFilter.h. |
|
Definition at line 300 of file itkMRFImageFilter.h. |
|
|
|
|
|
Allocate memory for labelled images. |
|
Apply MRF Classifier. In this example the images are labelled using Iterated Conditional Mode algorithm by J. Besag, "On statistical analysis of dirty pictures," J. Royal Stat. Soc. B, vol. 48, pp. 259-302, 1986. |
|
|
|
Give the process object a chance to indictate that it will produce more output than it was requested to produce. For example, many imaging filters must compute the entire output at once or can only produce output in complete slices. Such filters cannot handle smaller requested regions. These filters must provide an implementation of this method, setting the output requested region to the size they will produce. By default, a process object does not modify the size of the output requested region. Reimplemented from itk::ProcessObject. |
|
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 ThreadedGenerateData(). 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 an be threaded, it should NOT provide a GenerateData() method but should provide a ThreadedGenerateData() instead.
Reimplemented from itk::ImageSource< TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
What is the input requested region that is required to produce the output requested region? The base assumption for image processing filters is that the input requested region can be set to match the output requested region. If a filter requires more input (for instance a filter that uses neighborhoods needs more input than output to avoid introducing artificial boundary conditions) or less input (for instance a magnify filter) will have to override this method. In doing so, it should call its superclass' implementation as its first step. Note that imaging filters operate differently than the classes to this point in the class hierachy. Up till now, the base assumption has been that the largest possible region will be requested of the input. This implementation of GenerateInputRequestedRegion() only processes the inputs that are a subclass of the ImageBase<InputImageDimension>. If an input is another type of DataObject (including an Image of a different dimension), they are skipped by this method. The subclasses of ImageToImageFilter are responsible for providing an implementation of GenerateInputRequestedRegion() when there are multiple inputs of different types.
Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. |
|
Generate the information decribing the output data. The default implementation of this method will copy information from the input to the output. A filter may override this method if its output will have different information than its input. For instance, a filter that shrinks an image will need to provide an implementation for this method that changes the spacing of the pixels. Such filters should call their superclass' implementation of this method prior to changing the information values they need (i.e. GenerateOutputInformation() should call Superclass::GenerateOutputInformation() prior to changing the information. Reimplemented from itk::ProcessObject. |
|
Set/Get the error tollerance level which is used as a threshold to quit the iterations |
|
Set/Get the number of iteration of the Iterated Conditional Mode (ICM) algorithm. A default value is set at 50 iterations. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Set the weighting parameters (used in MRF algorithms). This is a function allowing the users to set the weight matrix by providing a a 1D array of weights. The default implementation supports a 3 x 3 x 3 kernel. The labeler needs to be extended for a different kernel size. Definition at line 293 of file itkMRFImageFilter.h. |
|
Run-time type information (and related methods). Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Get the neighborhood radius Definition at line 277 of file itkMRFImageFilter.h. |
|
Set/Get the number of classes. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
|
|
Set/Get the degree of smoothing desired |
|
Get condition that stops the MRF filter (Number of Iterations / Error tolerance ) |
|
Labelled Image dimension |
|
Image dimension Reimplemented from itk::ImageToImageFilter< TInputImage, TClassifiedImage >. |
|
Minimization algorithm to be used. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Method for creation through the object factory. Reimplemented from itk::Object. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
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::ImageToImageFilter< TInputImage, TClassifiedImage >. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Set the pointer to the classifer being used. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Set/Get the error tollerance level which is used as a threshold to quit the iterations |
|
Set/Get the number of iteration of the Iterated Conditional Mode (ICM) algorithm. A default value is set at 50 iterations. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Set the weighting parameters (used in MRF algorithms). This is a function allowing the users to set the weight matrix by providing a a 1D array of weights. The default implementation supports a 3 x 3 x 3 kernel. The labeler needs to be extended for a different kernel size. |
|
|
|
Sets the radius for the neighborhood, calculates size from the radius, and allocates storage. |
|
Set the neighborhood radius |
|
Set/Get the number of classes. Reimplemented in itk::RGBGibbsPriorFilter< TInputImage, TClassifiedImage >. |
|
Set/Get the degree of smoothing desired |