ITK
4.3.0
Insight Segmentation and Registration Toolkit
|
#include <itkPatchBasedDenoisingBaseImageFilter.h>
Base class for patch-based denoisng algorithms.
Implementation of a denoising filter that uses iterative non-local, or semi-local, weighted averaging of image patches for image denoising. The intensity at each pixel 'p' gets updated as a weighted average of intensities of a chosen subset of pixels from the image. The weights are derived using a kernel function on distances between (i) the patch around pixel p and (ii) the patches around the chosen subset of pixels in the image. This class of methods is motivated by texture-based image models and relies on nonparametric statistical modeling in the high-dimensional space of image patches. The choice of an appropriate kernel bandwidth parameter underlying nonparametric modeling can be important and may be estimated using cross-validation schemes.
Engineering issues underlying this class of methods include the choice of the patch size, the definition of a weighting mask on patches (e.g. to make patches more isotropic and less rectangular), the number of iterations over the image, the scheme for sampling patches from the image, and the weights balancing the regularization and data fidelity when the noise model is known.
This class of methods stems from the following two independent and simultaneous publications:
Suyash P. Awate, Ross T. Whitaker. Higher-Order Image Statistics for Unsupervised, Information-Theoretic, Adaptive, Image Filtering. IEEE Int. Conf. Computer Vision and Pattern Recognition (CVPR) 2005; (2):44-51.
Antoni Buades, Bartomeu Coll, Jean-Michel Morel. A Non-Local Algorithm for Image Denoising. IEEE Int. Conf. Computer Vision and Pattern Recognition (CVPR) 2005; (2):60-65.
While the former work considers the denoising algorithm as performing entropy reduction using nonparametric density estimation, the latter work treats it as nonparametric regression. Details underlying this class of methods appear in:
Suyash P. Awate, Ross T. Whitaker. Unsupervised, Information-Theoretic, Adaptive Image Filtering for Image Restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) 2006; 28(3):364-376.
Antoni Buades, Bartomeu Coll, Jean-Michel Morel. Nonlocal Image and Movie Denoising. International Journal of Computer Vision (IJCV) 2008; 76(2):123-139.
This class provides the base software framework for implementing patch-based denoising methods for multi-dimensional and multi-channel (i.e. vector-valued pixels) images. This framework is multithreaded on shared-memory architectures. Multithreading is incorporated in, both, intensity-updates and bandwidth-estimation stages by subdividing the image domain and associating each sub-domain to a single thread for processing.
To prevent oversmoothing, this class provides the framework for including a data-fidelity term based on the knowledge of the noise model. The intensity updates are then treated as the sum of (1) the weighted smoothing updates and (2) the weighted fidelity updates that prevent large deviations of the denoised image from the noisy data.
Definition at line 93 of file itkPatchBasedDenoisingBaseImageFilter.h.
Static Public Attributes | |
static const unsigned int | ImageDimension = InputImageType::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static const unsigned int | InputImageDimension = TInputImage::ImageDimension |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static const unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Attributes | |
bool | m_AlwaysTreatComponentsAsEuclidean |
ComponentSpaceType | m_ComponentSpace |
bool | m_DoKernelBandwidthEstimation |
unsigned int | m_ElapsedIterations |
double | m_FidelityWeight |
const InputImageType * | m_InputImage |
unsigned int | m_KernelBandwidthUpdateFrequency |
bool | m_ManualReinitialization |
NoiseModelType | m_NoiseModel |
unsigned int | m_NumberOfIterations |
OutputImageType * | m_OutputImage |
unsigned int | m_PatchRadius |
PatchWeightsType | m_PatchWeights |
double | m_SmoothingWeight |
Private Member Functions | |
void | operator= (const Self &) |
PatchBasedDenoisingBaseImageFilter (const Self &) | |
Private Attributes | |
FilterStateType | m_State |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(OutputImageDimension), itkGetStaticConstMacro(InputImageDimension) > | InputToOutputRegionCopierType |
typedef ImageToImageFilterDetail::ImageRegionCopier < itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension) > | OutputToInputRegionCopierType |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
typedef ZeroFluxNeumannBoundaryCondition<OutputImageType> itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::BoundaryConditionType |
This data structure type is used for efficiently accessing patch values from the image data structure.
Definition at line 141 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef SmartPointer<const Self> itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ConstPointer |
Definition at line 101 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef ConstNeighborhoodIterator< InputImageType, BoundaryConditionType > itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImagePatchIterator |
Definition at line 146 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef TInputImage itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImageType |
Input and output image types.
Definition at line 104 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef InputImageType::PixelType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputPixelType |
Type definition for the input and output pixel types. Output pixel type will be used in computations.
Definition at line 117 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef typename::itk::Statistics::ImageToNeighborhoodSampleAdaptor< OutputImageType, BoundaryConditionType > itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ListAdaptorType |
Definition at line 143 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef TOutputImage itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputImageType |
Definition at line 108 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef OutputImageType::PixelType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputPixelType |
Definition at line 118 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef ListAdaptorType::NeighborhoodRadiusType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PatchRadiusType |
Definition at line 144 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef Array<float> itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PatchWeightsType |
This data structure type is used to store the weights (mask) for pixels in a patch in order to make the patch more isotropic and less rectangular.
Definition at line 136 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef OutputPixelType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelType |
Definition at line 119 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef NumericTraits<PixelType>::ValueType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelValueType |
Definition at line 120 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef SmartPointer<Self> itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Pointer |
Definition at line 100 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef PatchBasedDenoisingBaseImageFilter itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Self |
Standard class typedefs.
Definition at line 98 of file itkPatchBasedDenoisingBaseImageFilter.h.
typedef ImageToImageFilter<TInputImage, TOutputImage> itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Superclass |
Definition at line 99 of file itkPatchBasedDenoisingBaseImageFilter.h.
enum itk::PatchBasedDenoisingBaseImageFilter::ComponentSpaceType |
Type definition to determine which space to do calculations in. TODO add comment about why no noise model can be used for RIEMANNIAN space
Definition at line 129 of file itkPatchBasedDenoisingBaseImageFilter.h.
enum itk::PatchBasedDenoisingBaseImageFilter::FilterStateType |
Definition at line 131 of file itkPatchBasedDenoisingBaseImageFilter.h.
enum itk::PatchBasedDenoisingBaseImageFilter::NoiseModelType |
Type definition for selecting the noise model.
Definition at line 123 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
|
protected |
|
private |
|
protectedpure virtual |
Allocate memory for a temporary update container in the subclass.
Implemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get flag indicating whether all components should always be treated as if they are in euclidean space regardless of pixel type. Defaults to false.
|
virtual |
Set/Get flag indicating whether all components should always be treated as if they are in euclidean space regardless of pixel type. Defaults to false.
|
protectedpure virtual |
Implemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
protectedpure virtual |
Perform one iteration of image denoising.
Implemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
protectedpure virtual |
Automatically estimate kernel bandwidth from the image data.
Implemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
protectedpure virtual |
Implemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
inlineprotected |
Determine the component space based on pixel type
Definition at line 299 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 304 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 309 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 315 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to true.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to true.
|
protectedvirtual |
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< TOutputImage >.
|
protectedvirtual |
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 hierarchy. 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, TOutputImage >.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get flag indicating whether all components should always be treated as if they are in euclidean space regardless of pixel type. Defaults to false.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to true.
|
virtual |
Get the number of elapsed iterations of the filter.
|
virtual |
Set/Get the weight on the fidelity term (penalizes deviations from the noisy data). This option is used when a noise model is specified. This weight controls the balance between the smoothing and the closeness to the noisy data.
|
virtual |
Set/Get the update frequency for the kernel bandwidth estimation. An optimal bandwidth will be re-estimated based on the denoised image after every 'n' iterations. Must be a positive integer. Defaults to 3, i.e. bandwidth updated after every 3 denoising iteration.
|
virtual |
Require the filter to be manually reinitialized (by calling SetStateToUninitialized()
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the noise model type. Defaults to GAUSSIAN. To use the noise model during denoising, FidelityWeight must be positive.
|
virtual |
Set/Get the number of denoising iterations to perform. Must be a positive integer. Defaults to 5.
PatchRadiusType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::GetPatchDiameterInVoxels | ( | ) | const |
PatchRadiusType::SizeValueType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::GetPatchLengthInVoxels | ( | ) | const |
|
virtual |
Set/Get the patch radius specified in physical coordinates. Patch radius is preferably set to an even number. Currently, only isotropic patches in physical space are allowed; patches can be anisotropic in voxel space.
PatchRadiusType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::GetPatchRadiusInVoxels | ( | ) | const |
PatchWeightsType itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::GetPatchWeights | ( | ) | const |
|
virtual |
Set/Get the weight on the smoothing term. This option is used when a noise model is specified. This weight controls the balance between the smoothing and the closeness to the noisy data.
|
virtual |
Set/Get the state of the filter.
|
protectedvirtual |
Check and indicate whether to continue iterations or stop.
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 269 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 276 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protectedvirtual |
Allocate memory and initialize patch weights.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Require the filter to be manually reinitialized (by calling SetStateToUninitialized()
|
virtual |
Require the filter to be manually reinitialized (by calling SetStateToUninitialized()
|
private |
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 286 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Definition at line 274 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protectedvirtual |
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, TOutputImage >.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get flag indicating whether all components should always be treated as if they are in euclidean space regardless of pixel type. Defaults to false.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to true.
|
protectedvirtual |
|
virtual |
Set/Get the weight on the fidelity term (penalizes deviations from the noisy data). This option is used when a noise model is specified. This weight controls the balance between the smoothing and the closeness to the noisy data.
|
virtual |
Set/Get the update frequency for the kernel bandwidth estimation. An optimal bandwidth will be re-estimated based on the denoised image after every 'n' iterations. Must be a positive integer. Defaults to 3, i.e. bandwidth updated after every 3 denoising iteration.
|
virtual |
Require the filter to be manually reinitialized (by calling SetStateToUninitialized()
|
virtual |
Set/Get the noise model type. Defaults to GAUSSIAN. To use the noise model during denoising, FidelityWeight must be positive.
|
virtual |
Set/Get the number of denoising iterations to perform. Must be a positive integer. Defaults to 5.
|
virtual |
Set/Get the patch radius specified in physical coordinates. Patch radius is preferably set to an even number. Currently, only isotropic patches in physical space are allowed; patches can be anisotropic in voxel space.
void itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::SetPatchWeights | ( | const PatchWeightsType & | weights | ) |
Set/Get the patch weights, or mask, that make the patch more isotropic (less rectangular). This function allows the user to set arbitrary patch weights by providing a 1-D array of weights.
|
virtual |
Set/Get the weight on the smoothing term. This option is used when a noise model is specified. This weight controls the balance between the smoothing and the closeness to the noisy data.
|
virtual |
Set/Get the state of the filter.
|
virtual |
Set the state of the filter to INITIALIZED
|
virtual |
Set the state of the filter to UNINITIALIZED
|
inlineprotectedvirtual |
Definition at line 291 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
static |
Image dimension, assumed to be the same for input and output data.
Definition at line 112 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Parameter indicating whether components should be treated as if they are in Euclidean space regardless of pixel type.
Definition at line 340 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 341 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Parameters that define the strategy for kernel-bandwidth estimation.
Definition at line 325 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 331 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 336 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
cache input and output pointer to get rid of thousands of calls to GetInput and GetOutput.
Definition at line 350 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 326 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Indicates whether the filter automatically resets to UNINITIALIZED state after completing, or whether filter must be manually reset
Definition at line 345 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Parameters defining the usage of a specific noise model, if desired.
Definition at line 334 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Parameters that define the total number of denoising iterations to perform and those completed so far.
Definition at line 330 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 351 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Parameters that define patch size and patch weights (mask).
Definition at line 321 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 322 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 335 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
State that the filter is in, i.e. UNINITIALIZED or INITIALIZED
Definition at line 358 of file itkPatchBasedDenoisingBaseImageFilter.h.