Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
itkLocalVariationImageFilter.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __itkLocalVariationImageFilter_h
14 #define __itkLocalVariationImageFilter_h
15 
16 #include "itkImage.h"
17 #include "itkImageToImageFilter.h"
18 
19 namespace itk
20 {
21  template <class TPixelType>
23  {
24  public:
25  static double Calc(TPixelType p);
26  };
27 
40  template <class TInputImage, class TOutputImage>
41  class LocalVariationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
42  {
43  public:
45  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
46  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
47 
49  typedef TInputImage InputImageType;
50  typedef TOutputImage OutputImageType;
51 
54  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
57 
59  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
60 
61 
62  itkTypeMacro(LocalVariationImageFilter, ImageToImageFilter);
63 
65  typedef typename InputImageType::PixelType InputPixelType;
66  typedef typename OutputImageType::PixelType OutputPixelType;
67 
68  typedef typename InputImageType::RegionType InputImageRegionType;
69  typedef typename OutputImageType::RegionType OutputImageRegionType;
70 
71  typedef typename InputImageType::SizeType InputSizeType;
72 
79  void GenerateInputRequestedRegion() override;
80 
81  protected:
82  LocalVariationImageFilter();
83  ~LocalVariationImageFilter() override {}
84  void PrintSelf(std::ostream &os, Indent indent) const override;
85 
96  void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override;
97 
98  private:
99  LocalVariationImageFilter(const Self &); // purposely not implemented
100  void operator=(const Self &); // purposely not implemented
101  };
102 
103 } // end namespace itk
104 
105 #ifndef ITK_MANUAL_INSTANTIATION
107 #endif
108 
109 #endif // LocalVariationImageFilter
InputImageType::RegionType InputImageRegionType
OutputImageType::PixelType OutputPixelType
Calculates the local variation in each pixel.
OutputImageType::RegionType OutputImageRegionType
ImageToImageFilter< InputImageType, OutputImageType > Superclass
static double Calc(TPixelType p)
unsigned short PixelType