18 #ifndef __itkPatchBasedDenoisingImageFilter_h
19 #define __itkPatchBasedDenoisingImageFilter_h
62 template <
class TInputImage,
class TOutputImage>
85 itkStaticConstMacro(ImageDimension,
unsigned int,
86 Superclass::ImageDimension);
146 itkSetMacro(UseSmoothDiscPatchWeights,
bool);
147 itkBooleanMacro(UseSmoothDiscPatchWeights);
148 itkGetConstMacro(UseSmoothDiscPatchWeights,
bool);
163 itkSetClampMacro(FractionPixelsForSigmaUpdate,
double, 0.01, 1.0);
164 itkGetConstReferenceMacro(FractionPixelsForSigmaUpdate,
double);
169 itkSetMacro(ComputeConditionalDerivatives,
bool);
170 itkBooleanMacro(ComputeConditionalDerivatives);
171 itkGetConstMacro(ComputeConditionalDerivatives,
bool);
187 itkSetMacro(UseFastTensorComputations,
bool);
188 itkBooleanMacro(UseFastTensorComputations);
189 itkGetConstMacro(UseFastTensorComputations,
bool);
193 itkStaticConstMacro(MaxSigmaUpdateIterations,
unsigned int,
201 itkSetClampMacro(SigmaMultiplicationFactor,
double, 0.01, 100);
202 itkGetConstReferenceMacro(SigmaMultiplicationFactor,
double);
208 void SetNoiseSigma(
const RealType& sigma);
210 itkGetConstMacro(NoiseSigma,
RealType);
220 virtual void PrintSelf(std::ostream& os,
Indent indent)
const;
223 virtual void EmptyCaches();
226 virtual void AllocateUpdateBuffer();
228 virtual void CopyInputToOutput();
230 virtual void GenerateInputRequestedRegion();
238 template<
typename T>
240 IsSame<T, typename NumericTraits<T>::ValueType>::Value,
242 GetComponent(
const T pix,
243 unsigned int itkNotUsed( idx ) )
const
254 template<
typename T>
256 IsSame<T, typename NumericTraits<T>::ValueType>::Value,
258 GetComponent(
const T& pix,
259 unsigned int idx )
const
265 template<
typename T >
267 SetComponent( T &pix,
268 unsigned int itkNotUsed( idx ),
275 template<
typename T >
277 SetComponent( T &pix,
291 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
293 DispatchedRiemannianMinMax(img);
297 DispatchedArrayMinMax(img);
301 template<
typename TImageType>
303 IsSame<typename TImageType::PixelType, typename NumericTraits<typename TImageType::PixelType>::ValueType>::Value
305 ComputeMinMax(
const TImageType* img)
307 DispatchedMinMax(img);
310 template<
typename TImageType>
312 IsSame<typename TImageType::PixelType, typename NumericTraits<typename TImageType::PixelType>::ValueType>::Value
314 ComputeMinMax(
const TImageType* img)
316 DispatchedArrayMinMax(img);
330 bool useCachedComputations,
336 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
338 ComputeLogMapAndWeightedSquaredGeodesicDifference(a, b, weight,
339 useCachedComputations, cacheIndex,
340 eigenValsCache, eigenVecsCache,
345 ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(a, b, weight,
346 useCachedComputations, cacheIndex,
347 eigenValsCache, eigenVecsCache,
353 template <
class PixelT>
354 void ComputeDifferenceAndWeightedSquaredNorm(
const PixelT& a,
357 bool useCachedComputations,
363 ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(a, b, weight,
364 useCachedComputations, cacheIndex,
365 eigenValsCache, eigenVecsCache,
375 if (this->m_ComponentSpace == Superclass::RIEMANNIAN)
377 return this->AddExponentialMapUpdate(a, b);
381 return this->AddEuclideanUpdate(a, b);
386 template <
class RealT>
390 return this->AddEuclideanUpdate(a, b);
393 virtual void EnforceConstraints();
395 virtual void Initialize();
397 virtual void InitializeKernelSigma();
399 virtual void InitializePatchWeights();
401 virtual void InitializePatchWeightsSmoothDisc();
403 virtual void InitializeIteration();
405 virtual void ComputeKernelBandwidthUpdate();
409 virtual ThreadDataStruct ThreadedComputeSigmaUpdate(
const InputImageRegionType& regionToProcess,
410 const int itkNotUsed(threadId),
411 ThreadDataStruct threadData);
413 virtual RealArrayType ResolveSigmaUpdate();
415 virtual void ComputeImageUpdate();
417 virtual ThreadDataStruct ThreadedComputeImageUpdate(
const InputImageRegionType& regionToProcess,
419 ThreadDataStruct threadData);
421 virtual RealType ComputeGradientJointEntropy(InstanceIdentifier
id,
422 typename ListAdaptorType::Pointer& inList,
423 BaseSamplerPointer& sampler,
424 ThreadDataStruct& threadData);
426 virtual void ApplyUpdate();
428 virtual void ThreadedApplyUpdate(
const InputImageRegionType& regionToProcess,
429 const int itkNotUsed(threadId) );
431 virtual void PostProcessOutput();
433 virtual void SetThreadData(
int threadId,
const ThreadDataStruct& data);
435 virtual ThreadDataStruct GetThreadData(
int threadId);
473 void operator=(
const Self&);
487 template <
typename TInputImageType>
488 void DispatchedMinMax(
const TInputImageType* img);
490 template <
typename TInputImageType>
491 void DispatchedArrayMinMax(
const TInputImageType* img);
493 template <
typename TInputImageType>
494 void DispatchedVectorMinMax(
const TInputImageType* img);
496 template <
typename TInputImageType>
497 void DispatchedRiemannianMinMax(
const TInputImageType* img);
504 const int itkNotUsed(threadId),
508 virtual void ResolveRiemannianMinMax();
510 void ComputeSignedEuclideanDifferenceAndWeightedSquaredNorm(
const PixelType& a,
const PixelType& b,
512 bool useCachedComputations,
522 bool useCachedComputations,
528 template <
typename TensorValueT>
549 #ifndef ITK_MANUAL_INSTANTIATION
550 # include "itkPatchBasedDenoisingImageFilter.hxx"