NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkSubsampleImageFilter.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 
15 #ifndef itkSubsampleImageFilter_h
16 #define itkSubsampleImageFilter_h
17 
18 #include <itkImageToImageFilter.h>
19 #include <itkMacro.h>
20 #include <itkArray.h>
21 
22 
23 namespace itk {
24 
31 template < class TInputImage, class TOutputImage >
32 class ITK_EXPORT SubsampleImageFilter :
33  public ImageToImageFilter< TInputImage, TOutputImage >
34 {
35 public:
38  typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
39  typedef SmartPointer<Self> Pointer;
40  typedef SmartPointer<const Self> ConstPointer;
41 
43  itkNewMacro(Self);
44 
46  itkTypeMacro(SubsampleImageFilter, ImageToImageFilter);
47 /*
48  itkLogMacro(DEBUG, "DEBUG message by itkLogMacro\n");
49  itkLogMacro(INFO, "INFO message by itkLogMacro\n");
50  itkLogMacro(WARNING, "WARNING message by itkLogMacro\n");
51  itkLogMacro(CRITICAL, "CRITICAL message by itkLogMacro\n");
52  itkLogMacro(FATAL, "FATAL message by itkLogMacro\n");
53  itkLogMacro(MUSTFLUSH, "MUSTFLUSH message by itkLogMacro\n");
54 */
56  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
57  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
58 
60  typedef typename Superclass::InputImageType InputImageType;
61  typedef typename Superclass::OutputImageType OutputImageType;
62  typedef typename Superclass::InputImagePointer InputImagePointer;
63  typedef typename Superclass::OutputImagePointer OutputImagePointer;
64  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
65 
67  void SetSubsamplingFactors(double data[]);
68  void SetSubsamplingFactors(double factor);
69  void SetSubsamplingFactors(itk::Array< double > &sampling);
70  itkGetVectorMacro(SubsamplingFactors, const double, TInputImage::ImageDimension);
71 
78  virtual void GenerateOutputInformation();
79 
86  virtual void GenerateInputRequestedRegion();
87 
88  itkSetMacro(MaximumError,double);
89  itkGetConstReferenceMacro(MaximumError,double);
90 
91 
92 #ifdef ITK_USE_CONCEPT_CHECKING
93 
94  itkConceptMacro(SameDimensionCheck,
95  (Concept::SameDimension<ImageDimension, OutputImageDimension>));
96  itkConceptMacro(OutputHasNumericTraitsCheck,
97  (Concept::HasNumericTraits<typename TOutputImage::PixelType>));
99 #endif
100 
101 protected:
104  void PrintSelf(std::ostream&os, Indent indent) const;
105 
107  void GenerateData();
108 
109  double m_MaximumError;
110 
111  double m_SubsamplingFactors[TInputImage::ImageDimension];
112 
113 private:
114  SubsampleImageFilter(const Self&); //purposely not implemented
115  void operator=(const Self&); //purposely not implemented
116 
117 };
118 
119 
120 } // namespace itk
121 
122 #ifndef ITK_MANUAL_INSTANTIATION
123 #include "itkSubsampleImageFilter.txx"
124 #endif
125 
126 #endif
Superclass::OutputImagePointer OutputImagePointer
Definition: itkSubsampleImageFilter.h:63
Superclass::InputImageConstPointer InputImageConstPointer
Definition: itkSubsampleImageFilter.h:64
SubsampleImageFilter Self
Definition: itkSubsampleImageFilter.h:37
Filter to subsample an image by a certain factor and apply the appropriate blurring (equivalent to vo...
Definition: itkSubsampleImageFilter.h:32
Superclass::OutputImageType OutputImageType
Definition: itkSubsampleImageFilter.h:61
Definition: niftkITKAffineResampleImage.cxx:74
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1363
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: itkSubsampleImageFilter.h:38
Superclass::InputImageType InputImageType
Definition: itkSubsampleImageFilter.h:60
SmartPointer< const Self > ConstPointer
Definition: itkSubsampleImageFilter.h:40
~SubsampleImageFilter()
Definition: itkSubsampleImageFilter.h:103
SmartPointer< Self > Pointer
Definition: itkSubsampleImageFilter.h:39
double m_MaximumError
Definition: itkSubsampleImageFilter.h:109
Superclass::InputImagePointer InputImagePointer
Definition: itkSubsampleImageFilter.h:62