ITK
6.0.0
Insight Toolkit
|
#include <itkPatchBasedDenoisingBaseImageFilter.h>
Base class for patch-based denoising 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 (weighted by SmoothingWeight) and (2) the weighted fidelity updates (weighted by NoiseModelFidelityWeight) that prevent large deviations of the denoised image from the noisy data.
Definition at line 145 of file itkPatchBasedDenoisingBaseImageFilter.h.
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = InputImageType::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Attributes | |
const InputImageType * | m_InputImage {} |
OutputImageType * | m_OutputImage {} |
Protected Attributes inherited from itk::ImageSource< TOutputImage > | |
bool | m_DynamicMultiThreading { true } |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime {} |
bool | m_Updating {} |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
Private Attributes | |
bool | m_AlwaysTreatComponentsAsEuclidean { false } |
ComponentSpaceEnum | m_ComponentSpace { ComponentSpaceEnum::EUCLIDEAN } |
unsigned int | m_ElapsedIterations { 0 } |
bool | m_KernelBandwidthEstimation { false } |
unsigned int | m_KernelBandwidthUpdateFrequency { 3 } |
bool | m_ManualReinitialization { false } |
NoiseModelEnum | m_NoiseModel { NoiseModelEnum::NOMODEL } |
double | m_NoiseModelFidelityWeight { 0.0 } |
unsigned int | m_NumberOfIterations { 1 } |
unsigned int | m_PatchRadius { 4 } |
PatchWeightsType | m_PatchWeights {} |
double | m_SmoothingWeight { 1.0 } |
FilterStateEnum | m_State { FilterStateEnum::UNINITIALIZED } |
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::BoundaryConditionType = ZeroFluxNeumannBoundaryCondition<OutputImageType> |
This data structure type is used for efficiently accessing patch values from the image data structure.
Definition at line 202 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ComponentSpaceEnum = PatchBasedDenoisingBaseImageFilterEnums::ComponentSpace |
Definition at line 175 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 154 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::FilterStateEnum = PatchBasedDenoisingBaseImageFilterEnums::FilterState |
Definition at line 176 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImagePatchIterator = ConstNeighborhoodIterator<InputImageType, BoundaryConditionType> |
Definition at line 206 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImageType = TInputImage |
Input and output image types.
Definition at line 160 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputPixelType = typename InputImageType::PixelType |
Type definition for the input and output pixel types. Output pixel type will be used in computations.
Definition at line 169 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ListAdaptorType = typename itk::Statistics::ImageToNeighborhoodSampleAdaptor<OutputImageType, BoundaryConditionType> |
Definition at line 203 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::NoiseModelEnum = PatchBasedDenoisingBaseImageFilterEnums::NoiseModel |
Definition at line 174 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputImageType = TOutputImage |
Definition at line 161 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputPixelType = typename OutputImageType::PixelType |
Definition at line 170 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PatchRadiusType = typename ListAdaptorType::NeighborhoodRadiusType |
Definition at line 205 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PatchWeightsType = Array<float> |
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 197 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelType = OutputPixelType |
Definition at line 171 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelValueType = typename NumericTraits<PixelType>::ValueType |
Definition at line 172 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Pointer = SmartPointer<Self> |
Definition at line 153 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Self = PatchBasedDenoisingBaseImageFilter |
Standard class type aliases.
Definition at line 151 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Superclass = ImageToImageFilter<TInputImage, TOutputImage> |
Definition at line 152 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
|
overrideprotecteddefault |
|
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.
|
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 |
Definition at line 402 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 409 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 396 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Determine the component space based on pixel type
Definition at line 390 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
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::ImageSource< TOutputImage >.
|
overrideprotectedvirtual |
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.
|
protectedvirtual |
Set/Get the component space type.
|
virtual |
Get the number of elapsed iterations of the filter.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to false.
|
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 |
Indicates whether the filter automatically resets to UNINITIALIZED state after completing, or whether filter must be manually reset. Require the filter to be manually reinitialized (by calling SetStateToUninitialized().
|
overridevirtual |
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get the noise model type. Defaults to NOMODEL. To use the noise model during denoising, NoiseModelFidelityWeight must be positive.
|
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. Use a positive weight to prevent oversmoothing.
|
virtual |
Set/Get the number of denoising iterations to perform. Must be a positive integer. Defaults to 1.
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. Large step sizes may cause instabilities.
|
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 346 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 358 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protectedvirtual |
Allocate memory and initialize patch weights.
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to false.
|
virtual |
Indicates whether the filter automatically resets to UNINITIALIZED state after completing, or whether filter must be manually reset. Require the filter to be manually reinitialized (by calling SetStateToUninitialized().
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 373 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Definition at line 354 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
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::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.
|
protectedvirtual |
Set/Get the component space type.
|
protectedvirtual |
|
virtual |
Set/Get flag indicating whether kernel-bandwidth should be estimated automatically from the image data. Defaults to false.
|
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 |
Indicates whether the filter automatically resets to UNINITIALIZED state after completing, or whether filter must be manually reset. Require the filter to be manually reinitialized (by calling SetStateToUninitialized().
|
virtual |
Set/Get the noise model type. Defaults to NOMODEL. To use the noise model during denoising, NoiseModelFidelityWeight must be positive.
|
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. Use a positive weight to prevent oversmoothing.
|
virtual |
Set/Get the number of denoising iterations to perform. Must be a positive integer. Defaults to 1.
|
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. Large step sizes may cause instabilities.
|
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 381 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
staticconstexpr |
Image dimension, assumed to be the same for input and output data.
Definition at line 164 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameter indicating whether components should be treated as if they are in Euclidean space regardless of pixel type.
Definition at line 445 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 446 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 436 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 421 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define the strategy for kernel-bandwidth estimation.
Definition at line 430 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 431 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 448 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters defining the usage of a specific noise model, if desired.
Definition at line 439 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 441 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define the total number of denoising iterations to perform and those completed so far.
Definition at line 435 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 422 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define patch size and patch weights (mask).
Definition at line 426 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 427 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 440 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 450 of file itkPatchBasedDenoisingBaseImageFilter.h.