ITK
5.0.0
Insight Segmentation and Registration 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 94 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 |
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 } |
ComponentSpaceType | m_ComponentSpace |
unsigned int | m_ElapsedIterations { 0 } |
bool | m_KernelBandwidthEstimation { false } |
unsigned int | m_KernelBandwidthUpdateFrequency { 3 } |
bool | m_ManualReinitialization { false } |
NoiseModelType | m_NoiseModel |
double | m_NoiseModelFidelityWeight { 0.0 } |
unsigned int | m_NumberOfIterations { 1 } |
unsigned int | m_PatchRadius { 4 } |
PatchWeightsType | m_PatchWeights |
double | m_SmoothingWeight { 1.0 } |
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) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
using | InputToOutputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::OutputImageDimension, Self::InputImageDimension > |
using | OutputToInputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::InputImageDimension, Self::OutputImageDimension > |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
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 144 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 104 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImagePatchIterator = ConstNeighborhoodIterator< InputImageType, BoundaryConditionType > |
Definition at line 149 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InputImageType = TInputImage |
Input and output image types.
Definition at line 110 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 119 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::ListAdaptorType = typename::itk::Statistics::ImageToNeighborhoodSampleAdaptor< OutputImageType, BoundaryConditionType > |
Definition at line 146 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputImageType = TOutputImage |
Definition at line 111 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::OutputPixelType = typename OutputImageType::PixelType |
Definition at line 120 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PatchRadiusType = typename ListAdaptorType::NeighborhoodRadiusType |
Definition at line 147 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 139 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelType = OutputPixelType |
Definition at line 121 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::PixelValueType = typename NumericTraits<PixelType>::ValueType |
Definition at line 122 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Pointer = SmartPointer<Self> |
Definition at line 103 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Self = PatchBasedDenoisingBaseImageFilter |
Standard class type aliases.
Definition at line 101 of file itkPatchBasedDenoisingBaseImageFilter.h.
using itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::Superclass = ImageToImageFilter<TInputImage, TOutputImage> |
Definition at line 102 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
Enumerator | |
---|---|
EUCLIDEAN | |
RIEMANNIAN |
Definition at line 131 of file itkPatchBasedDenoisingBaseImageFilter.h.
enum itk::PatchBasedDenoisingBaseImageFilter::FilterStateType |
State that the filter is in, i.e. UNINITIALIZED or INITIALIZED.
Enumerator | |
---|---|
UNINITIALIZED | |
INITIALIZED |
Definition at line 134 of file itkPatchBasedDenoisingBaseImageFilter.h.
enum itk::PatchBasedDenoisingBaseImageFilter::NoiseModelType |
Type definition for selecting the noise model.
Enumerator | |
---|---|
NOMODEL | |
GAUSSIAN | |
RICIAN | |
POISSON |
Definition at line 125 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.
|
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 306 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 311 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 316 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotected |
Definition at line 322 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().
|
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 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 stepsizes 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 276 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Reimplemented in itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >.
Definition at line 283 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 |
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().
|
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 293 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
inlineprotectedvirtual |
Definition at line 281 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 stepsizes 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 298 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
static |
Image dimension, assumed to be the same for input and output data.
Definition at line 114 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 358 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 359 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 349 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 329 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define the strategy for kernel-bandwidth estimation.
Definition at line 343 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 344 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 361 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters defining the usage of a specific noise model, if desired.
Definition at line 352 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 354 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define the total number of denoising iterations to perform and those completed so far.
Definition at line 348 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
protected |
Definition at line 335 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Parameters that define patch size and patch weights (mask).
Definition at line 339 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 340 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 353 of file itkPatchBasedDenoisingBaseImageFilter.h.
|
private |
Definition at line 363 of file itkPatchBasedDenoisingBaseImageFilter.h.