Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
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);
60  itkCloneMacro(Self);
61 
63  itkTypeMacro(LocalVariationImageFilter, ImageToImageFilter);
64 
66  typedef typename InputImageType::PixelType InputPixelType;
67  typedef typename OutputImageType::PixelType OutputPixelType;
68 
69  typedef typename InputImageType::RegionType InputImageRegionType;
70  typedef typename OutputImageType::RegionType OutputImageRegionType;
71 
72  typedef typename InputImageType::SizeType InputSizeType;
73 
80  void GenerateInputRequestedRegion() override;
81 
82  protected:
85  void PrintSelf(std::ostream &os, Indent indent) const override;
86 
97  void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override;
98 
99  private:
100  LocalVariationImageFilter(const Self &); // purposely not implemented
101  void operator=(const Self &); // purposely not implemented
102  };
103 
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
108 #endif
109 
110 #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)