NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkNLMFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 #ifndef __itkNLMFilter_h
15 #define __itkNLMFilter_h
16 
17 #include "itkImageToImageFilter.h"
19 #include "itkImage.h"
20 
21 namespace itk
22 {
23 
31 template <class TInputImage, class TOutputImage>
32 class ITK_EXPORT NLMFilter : public ImageToImageFilter< TInputImage, TOutputImage >
33 {
34 public:
36  typedef NLMFilter Self;
38  typedef TInputImage InputImageType;
39  typedef typename InputImageType::Pointer InputImagePointer;
40  typedef typename InputImageType::ConstPointer InputImageConstPointer;
41  typedef TOutputImage OutputImageType;
42  typedef typename OutputImageType::Pointer OutputImagePointer;
43 
45  typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
46  typedef SmartPointer<Self> Pointer;
47  typedef SmartPointer<const Self> ConstPointer;
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro( NLMFilter, ImageToImageFilter );
54 
62 
63 
64  typedef itk::Image< LSGradientsL2, TInputImage::ImageDimension > FeaturesMapType;
65  typedef typename FeaturesMapType::Pointer FeaturesMapPointer;
67  typedef typename L0Type::Pointer L0Pointer;
69  typedef typename L1Type::Pointer L1Pointer;
71  typedef typename L2Type::Pointer L2Pointer;
72 
73  itkSetMacro( Sigma, float );
74  itkGetMacro( Sigma, float );
75  itkSetMacro( H, float );
76  itkGetMacro( H, float );
77  itkSetMacro( PSTh, float );
78  itkGetMacro( PSTh, float );
79  itkSetMacro( RSearch, InputImageSizeType );
80  itkGetMacro( RSearch, InputImageSizeType );
81  itkSetMacro( RComp, InputImageSizeType );
82  itkGetMacro( RComp, InputImageSizeType );
83 
84 protected:
85  NLMFilter();
86  virtual ~NLMFilter();
87  // Threaded filter:
88 #if ITK_VERSION_MAJOR < 4
89  void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, int threadId );
90 
91 #else
92  void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId );
93 
94 #endif
95  void GenerateInputRequestedRegion();
96  void BeforeThreadedGenerateData( void );
97  void PrintSelf( std::ostream &os, Indent indent ) const;
98 private:
99  NLMFilter(const Self&); // purposely not implemented
100  void operator=(const Self&); // purposely not implemented
101  float ComputeTraceMO0( const InputImageSizeType& rcomp );
102  float ComputeTraceMO1( const InputImageSizeType& rcomp );
103  // The standard deviation of noise (in the complex domain)
104  float m_Sigma;
105  // The true parameteres of NLM:
106  float m_H;
107  float m_PSTh;
108  InputImageSizeType m_RSearch;
109  InputImageSizeType m_RComp;
110  FeaturesMapPointer m_Features;
111 };
112 
113 
114 
115 } // end namespace itk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkNLMFilter.txx"
119 #endif
120 
121 #endif
Definition: itkNLMFilter.h:32
OutputImageType::PixelType OutputPixelType
Definition: itkNLMFilter.h:57
L2Type::Pointer L2Pointer
Definition: itkNLMFilter.h:71
SmartPointer< Self > Pointer
Definition: itkLSDerivatives.h:119
NLMFilter Self
Definition: itkNLMFilter.h:36
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
SmartPointer< Self > Pointer
Definition: itkLSDerivatives.h:179
itk::LSDerivativesL1< TInputImage::ImageDimension > L1Type
Definition: itkNLMFilter.h:68
itk::LSDerivativesL0< InputImageType > L0Type
Definition: itkNLMFilter.h:66
TOutputImage OutputImageType
Definition: itkNLMFilter.h:41
FeaturesMapType::Pointer FeaturesMapPointer
Definition: itkNLMFilter.h:65
Definition: niftkITKAffineResampleImage.cxx:74
SmartPointer< const Self > ConstPointer
Definition: itkNLMFilter.h:47
SmartPointer< Self > Pointer
Definition: itkNLMFilter.h:46
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
itk::Image< LSGradientsL2, TInputImage::ImageDimension > FeaturesMapType
Definition: itkNLMFilter.h:64
OutputImageType::Pointer OutputImagePointer
Definition: itkNLMFilter.h:42
TInputImage InputImageType
Definition: itkNLMFilter.h:38
OutputImageType::RegionType OutputImageRegionType
Definition: itkNLMFilter.h:61
InputImageType::Pointer InputImagePointer
Definition: itkNLMFilter.h:39
Definition: itkLSDerivatives.h:44
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
InputImageType::ConstPointer InputImageConstPointer
Definition: itkNLMFilter.h:40
itk::LSDerivativesL2< TInputImage::ImageDimension > L2Type
Definition: itkNLMFilter.h:70
SmartPointer< Self > Pointer
Definition: itkLSDerivatives.h:59
Definition: itkLSDerivatives.h:105
L1Type::Pointer L1Pointer
Definition: itkNLMFilter.h:69
InputImageType::RegionType InputImageRegionType
Definition: itkNLMFilter.h:58
InputImageType::PixelType InputPixelType
Definition: itkNLMFilter.h:53
InputImageType::SizeType InputImageSizeType
Definition: itkNLMFilter.h:59
InputImageType::IndexType InputImageIndexType
Definition: itkNLMFilter.h:60
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Definition: itkNLMFilter.h:45
Definition: itkLSDerivatives.h:165
L0Type::Pointer L0Pointer
Definition: itkNLMFilter.h:67