Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkNonLocalMeansDenoisingFilter.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __itkNonLocalMeansDenoisingFilter_h_
18 #define __itkNonLocalMeansDenoisingFilter_h_
19 
20 #include "itkImageToImageFilter.h"
21 #include "itkVectorImage.h"
22 
23 
24 namespace itk{
32  template< class TPixelType >
34  public ImageToImageFilter< VectorImage < TPixelType, 3 >, VectorImage < TPixelType, 3 > >
35  {
36  public:
37 
42  typedef ImageToImageFilter< VectorImage < TPixelType, 3 >, VectorImage < TPixelType, 3 > > Superclass;
44  typedef typename Superclass::OutputImageType OutputImageType;
45  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
46  typedef Image <TPixelType, 3> MaskImageType;
47 
49  itkFactorylessNewMacro(Self)
50  itkCloneMacro(Self)
51 
53  itkTypeMacro(NonLocalMeansDenoisingFilter, ImageToImageFilter)
54 
58  itkSetMacro(UseJointInformation, bool)
65  itkSetMacro(SearchRadius, int)
72  itkSetMacro(ComparisonRadius, int)
79  itkSetMacro(Variance, double)
85  itkSetMacro(UseRicianAdaption, bool)
91  itkGetMacro(CurrentVoxelCount, unsigned int)
92 
93 
95  void SetInputImage(const InputImageType* image);
103  void SetInputMask(MaskImageType* mask);
104 
105  protected:
106  NonLocalMeansDenoisingFilter();
107  ~NonLocalMeansDenoisingFilter() {}
108 
116 
125  void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, ThreadIdType);
126 
127 
128 
129  private:
130 
131  int m_SearchRadius;
132  int m_ComparisonRadius;
133  bool m_UseJointInformation;
134  bool m_UseRicianAdaption;
135  unsigned int m_CurrentVoxelCount;
136  double m_Variance;
137  typename MaskImageType::Pointer m_Mask;
138  };
139 }
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
143 #endif
144 
145 #endif //__itkNonLocalMeansDenoisingFilter_h_
itk::SmartPointer< Self > Pointer
ImageToImageFilter< VectorImage< TPixelType, 3 >, VectorImage< TPixelType, 3 > > Superclass
This class denoises a vectorimage according to the non-local means procedure.
Superclass::OutputImageRegionType OutputImageRegionType
itk::Image< double, 3 > InputImageType
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType)
Denoising procedure.
void BeforeThreadedGenerateData()
Calculations which need to be done before the denoising starts.
void SetInputImage(const InputImageType *image)
Set the input image.
void SetInputMask(MaskImageType *mask)
Set a denoising mask.