ITK
6.0.0
Insight Toolkit
|
#include <itkPatchBasedDenoisingImageFilter.h>
Derived class implementing a specific patch-based denoising algorithm, as detailed below.
This class is derived from the base class PatchBasedDenoisingBaseImageFilter; please refer to the documentation of the base class first. This class implements 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.
This class implements the denoising algorithm using a Gaussian kernel function for nonparametric density estimation. The class implements a scheme to automatically estimated the kernel bandwidth parameter (namely, sigma) using leave-one-out cross validation. It implements schemes for random sampling of patches non-locally (from the entire image) as well as semi-locally (from the spatial proximity of the pixel being denoised at the specific point in time). It implements a specific scheme for defining patch weights (mask) as described in Awate and Whitaker 2005 IEEE CVPR and 2006 IEEE TPAMI.
Definition at line 62 of file itkPatchBasedDenoisingImageFilter.h.
Classes | |
struct | ThreadDataStruct |
struct | ThreadFilterStruct |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static double | GetGlobalDefaultCoordinateTolerance () |
static double | GetGlobalDefaultDirectionTolerance () |
static void | SetGlobalDefaultCoordinateTolerance (double) |
static void | SetGlobalDefaultDirectionTolerance (double) |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = Superclass::ImageDimension |
static constexpr unsigned int | MaxSigmaUpdateIterations = 20 |
Static Public Attributes inherited from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage > | |
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 Types | |
template<typename T , typename U = void> | |
using | DisableIfMultiComponent = typename std::enable_if< std::is_same_v< T, typename NumericTraits< T >::ValueType >, U > |
template<typename T , typename U = void> | |
using | EnableIfMultiComponent = typename std::enable_if<!std::is_same_v< T, typename NumericTraits< T >::ValueType >, U > |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
using | InputToOutputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::OutputImageDimension, Self::InputImageDimension > |
using | OutputToInputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::InputImageDimension, Self::OutputImageDimension > |
Private Member Functions | |
RealType | AddEuclideanUpdate (const RealType &a, const RealType &b) |
RealType | AddExponentialMapUpdate (const DiffusionTensor3D< RealValueType > &spdMatrix, const DiffusionTensor3D< RealValueType > &symMatrix) |
template<typename TensorValueT > | |
void | Compute3x3EigenAnalysis (const DiffusionTensor3D< TensorValueT > &spdMatrix, FixedArray< TensorValueT, 3 > &eigenVals, Matrix< TensorValueT, 3, 3 > &eigenVecs) |
void | ComputeLogMapAndWeightedSquaredGeodesicDifference (const DiffusionTensor3D< PixelValueType > &spdMatrixA, const DiffusionTensor3D< PixelValueType > &spdMatrixB, const RealArrayType &weight, bool useCachedComputations, SizeValueType cacheIndex, EigenValuesCacheType &eigenValsCache, EigenVectorsCacheType &eigenVecsCache, RealType &symMatrixLogMap, RealArrayType &geodesicDist) |
void | ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm (const PixelType &a, const PixelType &b, const RealArrayType &weight, bool useCachedComputations, SizeValueType cacheIndex, EigenValuesCacheType &eigenValsCache, EigenVectorsCacheType &eigenVecsCache, RealType &diff, RealArrayType &norm) |
template<typename TInputImageType > | |
void | DispatchedArrayMinMax (const TInputImageType *img) |
template<typename TInputImageType > | |
void | DispatchedMinMax (const TInputImageType *img) |
template<typename TInputImageType > | |
void | DispatchedRiemannianMinMax (const TInputImageType *img) |
template<typename TInputImageType > | |
void | DispatchedVectorMinMax (const TInputImageType *img) |
virtual void | ResolveRiemannianMinMax () |
ThreadDataStruct | ThreadedRiemannianMinMax (const InputImageRegionType ®ionToProcess, const int, const InputImageType *img, ThreadDataStruct threadData) |
Static Private Member Functions | |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ApplyUpdateThreaderCallback (void *arg) |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ComputeImageUpdateThreaderCallback (void *arg) |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ComputeSigmaUpdateThreaderCallback (void *arg) |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | RiemannianMinMaxThreaderCallback (void *arg) |
Additional Inherited Members | |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
Static Protected Member Functions inherited from itk::ProcessObject | |
template<typename TSourceObject > | |
static void | MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs) |
static constexpr float | progressFixedToFloat (uint32_t fixed) |
static uint32_t | progressFloatToFixed (float f) |
Protected Attributes inherited from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage > | |
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 {} |
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::BaseSamplerPointer = typename BaseSamplerType::Pointer |
Definition at line 116 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::BaseSamplerType = itk::Statistics::RegionConstrainedSubsampler<PatchSampleType, InputImageRegionType> |
Type definitions for delegate classes.
Definition at line 115 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 73 of file itkPatchBasedDenoisingImageFilter.h.
|
protected |
Definition at line 243 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::EigenValuesArrayType = FixedArray<PixelValueType, 3> |
Type definitions for Riemannian LogMap Eigensystem. Since the LogMap computations are only valid for DiffusionTensor3D pixels right now which always have a dimension of 3x3.
Definition at line 124 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::EigenValuesCacheType = std::vector<EigenValuesArrayType> |
Definition at line 126 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::EigenVectorsCacheType = std::vector<EigenVectorsMatrixType> |
Definition at line 127 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::EigenVectorsMatrixType = Matrix<PixelValueType, 3, 3> |
Definition at line 125 of file itkPatchBasedDenoisingImageFilter.h.
|
protected |
Definition at line 246 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::InputImageRegionConstIteratorType = ImageRegionConstIterator<InputImageType> |
Definition at line 94 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::InputImageRegionType = typename InputImageType::RegionType |
Type definition for the input image region and size type.
Definition at line 90 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::InstanceIdentifier = typename BaseSamplerType::InstanceIdentifier |
Definition at line 117 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::OutputImageRegionIteratorType = ImageRegionIterator<OutputImageType> |
Type definition for the input image region iterator
Definition at line 93 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::PatchSampleType = ListAdaptorType |
Definition at line 111 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::PixelArrayType = Array<PixelValueType> |
Definition at line 103 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::Pointer = SmartPointer<Self> |
Definition at line 72 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::RealArrayType = Array<RealValueType> |
Definition at line 104 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::RealType = typename NumericTraits<PixelType>::RealType |
Definition at line 101 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::RealValueType = typename NumericTraits<PixelValueType>::RealType |
Definition at line 102 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::Self = PatchBasedDenoisingImageFilter |
Standard class type aliases.
Definition at line 70 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ShortArrayType = Array<unsigned short> |
Definition at line 105 of file itkPatchBasedDenoisingImageFilter.h.
using itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::Superclass = PatchBasedDenoisingBaseImageFilter<TInputImage, TOutputImage> |
Definition at line 71 of file itkPatchBasedDenoisingImageFilter.h.
|
protected |
|
overrideprotected |
|
private |
|
private |
Returns the Exp map
|
inlineprotected |
Update a by adding b. In Riemannian space, b is in the tangent space of a.
Definition at line 374 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
Definition at line 389 of file itkPatchBasedDenoisingImageFilter.h.
|
overrideprotectedvirtual |
Allocate memory for a temporary update container in the subclass
Implements itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
overrideprotectedvirtual |
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire a region which it then passes to ThreadedApplyUpdate for processing.
|
private |
|
virtual |
Set/Get flag indicating whether conditional derivatives should be used estimating sigma.
|
inlineprotected |
Compute the signed difference a-b and the weighted squared distance between a and b. Do the computation in either Euclidean or Riemannian space depending on pixel type. The cache is used when the first argument is repeatedly passed into ComputeLogMap since the eigen analysis will already have been computed for that pixel.
Definition at line 331 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
Definition at line 356 of file itkPatchBasedDenoisingImageFilter.h.
|
protectedvirtual |
|
overrideprotectedvirtual |
Perform one iteration of image denoising.
Implements itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire a region which it then passes to ComputeImageUpdate for processing.
|
overrideprotectedvirtual |
Automatically estimate kernel bandwidth from the image data.
Implements itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
private |
Returns the Log map in the tangent space of spdMatrixA.
|
inlineprotected |
Compute the Minimum and Maximum pixel in the image for each independent component
Definition at line 296 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
Definition at line 310 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
Definition at line 317 of file itkPatchBasedDenoisingImageFilter.h.
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire an output region that it passes to ComputeSigma for processing.
|
private |
|
overrideprotectedvirtual |
|
private |
|
private |
|
private |
|
private |
|
protectedvirtual |
Clean up Eigensystem caches
|
protectedvirtual |
|
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::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
inlineprotected |
Definition at line 270 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
A method to generically get a component.
The same function name can be used to generically access for scalars and array-like types. For scalar types the idx parameter is ignored.
Definition at line 257 of file itkPatchBasedDenoisingImageFilter.h.
|
virtual |
Set/Get flag indicating whether conditional derivatives should be used estimating sigma.
|
virtual |
Set/Get the fraction of the image to use for kernel bandwidth sigma estimation. To reduce the computational burden for computing sigma, a small random fraction of the image pixels can be used.
|
virtual |
Set/Get the kernel bandwidth sigma multiplication factor used to modify the automatically-estimated kernel bandwidth sigma. At times, it may be desirable to modify the value of the automatically-estimated sigma. Typically, this number isn't very far from 1. Note: This is used only when KernelBandwidthEstimation is True/On.
|
virtual |
Set/Get initial kernel bandwidth estimate. To prevent the class from automatically modifying this estimate, set KernelBandwidthEstimation to false in the base class.
|
virtual |
Set/Get the class used for creating a subsample of patches.
|
overridevirtual |
Reimplemented from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
virtual |
|
virtual |
Get the number of independent components of the input.
|
protectedvirtual |
|
virtual |
Set/Get flag indicating whether the fast algorithm for tensor computations should be used.
Specifically, when this flag is true (default) or On, a faster implementation of the 3x3 symmetric positive-definite eigensystem analysis will be used. See Hasan KM, Basser PJ, Parker DL, Alexander AL. Analytical computation of the eigenvalues and eigenvectors in DT-MRI. J Magn Reson 2001; 152: 41-47. This faster algorithm may be slightly less accurate and possibly less stable in the presence of noise. So far in practice it has been shown to work well. However, you may want to turn this option off if you have concerns about numerical performance.
|
virtual |
Set/Get flag indicating whether smooth-disc patch weights should be used. If this flag is true, the smooth-disc patch weights will override any weights provided via the SetPatchWeights method.
|
overrideprotectedvirtual |
Reimplemented from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
overrideprotectedvirtual |
Reimplemented from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
protectedvirtual |
|
overrideprotectedvirtual |
Allocate memory and initialize patch weights.
Reimplemented from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
protectedvirtual |
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Reimplemented from itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
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::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >.
|
privatevirtual |
|
protectedvirtual |
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire a region which it then passes to ThreadedRiemannianMinMax for processing.
|
inlineprotected |
Definition at line 287 of file itkPatchBasedDenoisingImageFilter.h.
|
inlineprotected |
A method to generically set a component.
Definition at line 278 of file itkPatchBasedDenoisingImageFilter.h.
|
virtual |
Set/Get flag indicating whether conditional derivatives should be used estimating sigma.
|
virtual |
Set/Get the fraction of the image to use for kernel bandwidth sigma estimation. To reduce the computational burden for computing sigma, a small random fraction of the image pixels can be used.
|
virtual |
Set/Get the kernel bandwidth sigma multiplication factor used to modify the automatically-estimated kernel bandwidth sigma. At times, it may be desirable to modify the value of the automatically-estimated sigma. Typically, this number isn't very far from 1. Note: This is used only when KernelBandwidthEstimation is True/On.
void itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::SetKernelBandwidthSigma | ( | const RealArrayType & | kernelSigma | ) |
Set/Get initial kernel bandwidth estimate. To prevent the class from automatically modifying this estimate, set KernelBandwidthEstimation to false in the base class.
void itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::SetNoiseSigma | ( | const RealType & | sigma | ) |
Set/Get the noise sigma. Used by the noise model where appropriate, defaults to 5% of the image intensity range
|
virtual |
Set/Get the class used for creating a subsample of patches.
|
protectedvirtual |
|
virtual |
Set/Get flag indicating whether the fast algorithm for tensor computations should be used.
Specifically, when this flag is true (default) or On, a faster implementation of the 3x3 symmetric positive-definite eigensystem analysis will be used. See Hasan KM, Basser PJ, Parker DL, Alexander AL. Analytical computation of the eigenvalues and eigenvectors in DT-MRI. J Magn Reson 2001; 152: 41-47. This faster algorithm may be slightly less accurate and possibly less stable in the presence of noise. So far in practice it has been shown to work well. However, you may want to turn this option off if you have concerns about numerical performance.
|
virtual |
Set/Get flag indicating whether smooth-disc patch weights should be used. If this flag is true, the smooth-disc patch weights will override any weights provided via the SetPatchWeights method.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
private |
|
virtual |
Set/Get flag indicating whether the fast algorithm for tensor computations should be used.
Specifically, when this flag is true (default) or On, a faster implementation of the 3x3 symmetric positive-definite eigensystem analysis will be used. See Hasan KM, Basser PJ, Parker DL, Alexander AL. Analytical computation of the eigenvalues and eigenvectors in DT-MRI. J Magn Reson 2001; 152: 41-47. This faster algorithm may be slightly less accurate and possibly less stable in the presence of noise. So far in practice it has been shown to work well. However, you may want to turn this option off if you have concerns about numerical performance.
|
virtual |
Set/Get flag indicating whether smooth-disc patch weights should be used. If this flag is true, the smooth-disc patch weights will override any weights provided via the SetPatchWeights method.
|
staticconstexpr |
Image dimension, assumed to be the same for input and output data
Definition at line 87 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 563 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 561 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 560 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 558 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 562 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 569 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 556 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 557 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 565 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 564 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 571 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 573 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 572 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 549 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 548 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 575 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 576 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 568 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 567 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 566 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 543 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 550 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
The buffer that holds the updates for an iteration of the algorithm.
Definition at line 546 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 554 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 552 of file itkPatchBasedDenoisingImageFilter.h.
|
private |
Definition at line 559 of file itkPatchBasedDenoisingImageFilter.h.
|
staticconstexpr |
Maximum number of Newton-Raphson iterations for sigma update.
Definition at line 194 of file itkPatchBasedDenoisingImageFilter.h.