18 #ifndef __itkPatchBasedDenoisingImageFilter_h
19 #define __itkPatchBasedDenoisingImageFilter_h
58 template <
class TInputImage,
class TOutputImage>
81 itkStaticConstMacro(ImageDimension,
unsigned int,
82 Superclass::ImageDimension);
131 itkSetMacro(UseSmoothDiscPatchWeights,
bool);
132 itkBooleanMacro(UseSmoothDiscPatchWeights);
133 itkGetConstMacro(UseSmoothDiscPatchWeights,
bool);
149 itkSetClampMacro(FractionPixelsForSigmaUpdate,
double, 0.01, 1.0);
150 itkGetConstReferenceMacro(FractionPixelsForSigmaUpdate,
double);
154 itkSetMacro(ComputeConditionalDerivatives,
bool);
155 itkBooleanMacro(ComputeConditionalDerivatives);
156 itkGetConstMacro(ComputeConditionalDerivatives,
bool);
160 itkStaticConstMacro(MaxSigmaUpdateIterations,
unsigned int,
168 itkSetClampMacro(SigmaMultiplicationFactor,
double, 0.01, 100);
169 itkGetConstReferenceMacro(SigmaMultiplicationFactor,
double);
175 void SetNoiseSigma(
const RealType& sigma);
176 itkGetConstMacro(NoiseSigma,
RealType);
188 virtual void PrintSelf(std::ostream& os,
Indent indent)
const;
191 virtual void AllocateUpdateBuffer();
193 virtual void CopyInputToOutput();
195 virtual void GenerateInputRequestedRegion();
203 template<
typename T>
205 IsSame<T, typename NumericTraits<T>::ValueType>::Value,
207 GetComponent(
const T pix,
208 unsigned int itkNotUsed( idx ) )
const
218 template<
typename T>
220 IsSame<T, typename NumericTraits<T>::ValueType>::Value,
222 GetComponent(
const T& pix,
223 unsigned int idx )
const
229 template<
typename T >
231 SetComponent( T &pix,
232 unsigned int itkNotUsed( idx ),
237 template<
typename T >
239 SetComponent( T &pix,
251 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
253 DispatchedRiemannianMinMax(img);
257 DispatchedArrayMinMax(img);
261 template<
typename TImageType>
263 IsSame<typename TImageType::PixelType, typename NumericTraits<typename TImageType::PixelType>::ValueType>::Value
265 ComputeMinMax(
const TImageType* img)
267 DispatchedMinMax(img);
269 template<
typename TImageType>
271 IsSame<typename TImageType::PixelType, typename NumericTraits<typename TImageType::PixelType>::ValueType>::Value
273 ComputeMinMax(
const TImageType* img)
275 DispatchedArrayMinMax(img);
288 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
290 ComputeLogMapAndWeightedSquaredGeodesicDifference(a, b, weight, diff, norm);
294 ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(a, b, weight, diff, norm);
297 template <
class PixelT>
298 void ComputeDifferenceAndWeightedSquaredNorm(
const PixelT& a,
303 ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(a, b, weight, diff, norm);
313 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
315 return this->AddExponentialMapUpdate(a, b);
319 return this->AddEuclideanUpdate(a, b);
322 template <
class RealT>
326 return this->AddEuclideanUpdate(a, b);
331 virtual void EnforceConstraints();
333 virtual void Initialize();
335 virtual void InitializeKernelSigma();
337 virtual void InitializePatchWeights();
338 virtual void InitializePatchWeightsSmoothDisc();
340 virtual void InitializeIteration();
342 virtual void ComputeKernelBandwidthUpdate();
343 virtual ThreadDataStruct ThreadedComputeSigmaUpdate(
const InputImageRegionType& regionToProcess,
344 const int itkNotUsed(threadId),
345 ThreadDataStruct threadData);
346 virtual RealArrayType ResolveSigmaUpdate();
349 virtual void ComputeImageUpdate();
350 virtual ThreadDataStruct ThreadedComputeImageUpdate(
const InputImageRegionType& regionToProcess,
352 ThreadDataStruct threadData);
353 virtual RealType ComputeGradientJointEntropy(InstanceIdentifier
id,
354 typename ListAdaptorType::Pointer& inList,
355 BaseSamplerPointer& sampler);
358 virtual void ApplyUpdate();
359 virtual void ThreadedApplyUpdate(
const InputImageRegionType& regionToProcess,
360 const int itkNotUsed(threadId));
363 virtual void PostProcessOutput();
365 virtual void SetThreadData(
int threadId,
const ThreadDataStruct& data);
366 virtual ThreadDataStruct GetThreadData(
int threadId);
402 void operator=(
const Self&);
416 template <
typename TInputImageType>
417 void DispatchedMinMax(
const TInputImageType* img);
419 template <
typename TInputImageType>
420 void DispatchedArrayMinMax(
const TInputImageType* img);
422 template <
typename TInputImageType>
423 void DispatchedVectorMinMax(
const TInputImageType* img);
425 template <
typename TInputImageType>
426 void DispatchedRiemannianMinMax(
const TInputImageType* img);
432 const int itkNotUsed(threadId),
436 virtual void ResolveRiemannianMinMax();
439 void ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(
const PixelType& a,
const PixelType& b,
465 #define ITK_TEMPLATE_PatchBasedDenoisingImageFilter(_, EXPORT, x, y) namespace itk { \
466 _(2(class EXPORT PatchBasedDenoisingImageFilter< ITK_TEMPLATE_2 x >)) | \
467 namespace Templates { typedef PatchBasedDenoisingImageFilter< ITK_TEMPLATE_2 x > \
468 PatchBasedDenoisingImageFilter##y; } \
471 #if ITK_TEMPLATE_EXPLICIT
472 # include "Templates/itkPatchBasedDenoisingImageFilter+-.h"
476 # include "itkPatchBasedDenoisingImageFilter.hxx"