Medical Imaging Interaction Toolkit  2016.11.0
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,
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 __itkLocalVariationImageFilter_h
18 #define __itkLocalVariationImageFilter_h
19 
20 #include "itkImage.h"
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
25  template <class TPixelType>
27  {
28  public:
29  static double Calc(TPixelType p);
30  };
31 
44  template <class TInputImage, class TOutputImage>
45  class LocalVariationImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
46  {
47  public:
49  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
50  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
51 
53  typedef TInputImage InputImageType;
54  typedef TOutputImage OutputImageType;
55 
58  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
61 
63  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
64 
66  itkTypeMacro(LocalVariationImageFilter, ImageToImageFilter);
67 
69  typedef typename InputImageType::PixelType InputPixelType;
70  typedef typename OutputImageType::PixelType OutputPixelType;
71 
72  typedef typename InputImageType::RegionType InputImageRegionType;
73  typedef typename OutputImageType::RegionType OutputImageRegionType;
74 
75  typedef typename InputImageType::SizeType InputSizeType;
76 
83  virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
84 
85  protected:
86  LocalVariationImageFilter();
87  virtual ~LocalVariationImageFilter() {}
88  void PrintSelf(std::ostream &os, Indent indent) const;
89 
100  void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId);
101 
102  private:
103  LocalVariationImageFilter(const Self &); // purposely not implemented
104  void operator=(const Self &); // purposely not implemented
105  };
106 
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
111 #endif
112 
113 #endif // LocalVariationImageFilter
InputImageType::RegionType InputImageRegionType
OutputImageType::PixelType OutputPixelType
Calculates the local variation in each pixel.
OutputImageType::RegionType OutputImageRegionType
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
void PrintSelf(std::ostream &os, Indent indent) const
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
ImageToImageFilter< InputImageType, OutputImageType > Superclass
virtual void GenerateInputRequestedRegion()
static double Calc(TPixelType p)
unsigned short PixelType