NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkSampleImageFilter.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 itkSampleImageFilter_h
16 #define itkSampleImageFilter_h
17 
18 #include <itkImageToImageFilter.h>
20 #include <itkMacro.h>
21 #include <itkArray.h>
22 
23 
24 namespace itk {
25 
32 template < class TInputImage, class TOutputImage >
33 class ITK_EXPORT SampleImageFilter :
34  public ImageToImageFilter< TInputImage, TOutputImage >
35 {
36 public:
39  typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
40  typedef SmartPointer<Self> Pointer;
41  typedef SmartPointer<const Self> ConstPointer;
42 
44  itkNewMacro(Self);
45 
47  itkTypeMacro(SampleImageFilter, ImageToImageFilter);
48 /*
49  itkLogMacro(DEBUG, "DEBUG message by itkLogMacro\n");
50  itkLogMacro(INFO, "INFO message by itkLogMacro\n");
51  itkLogMacro(WARNING, "WARNING message by itkLogMacro\n");
52  itkLogMacro(CRITICAL, "CRITICAL message by itkLogMacro\n");
53  itkLogMacro(FATAL, "FATAL message by itkLogMacro\n");
54  itkLogMacro(MUSTFLUSH, "MUSTFLUSH message by itkLogMacro\n");
55 */
57  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
58  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
59 
61  typedef typename Superclass::InputImageType InputImageType;
62  typedef typename Superclass::OutputImageType OutputImageType;
63  typedef typename Superclass::InputImagePointer InputImagePointer;
64  typedef typename Superclass::OutputImagePointer OutputImagePointer;
65  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
66 
68  void SetDebug(bool b) { itk::Object::SetDebug(b); }
70  void DebugOn() { this->SetDebug(true); }
72  void DebugOff() { this->SetDebug(false); }
73 
74  itkBooleanMacro( Verbose );
75  itkGetConstMacro( Verbose, bool );
76  itkSetMacro( Verbose, bool );
77 
78  itkBooleanMacro( IsotropicVoxels );
79  itkGetConstMacro( IsotropicVoxels, bool );
80  itkSetMacro( IsotropicVoxels, bool );
81 
83  void SetSamplingFactors(double data[]);
84  void SetSamplingFactors(itk::Array< double > &sampling);
85  itkGetVectorMacro(SamplingFactors, const double, TInputImage::ImageDimension);
86 
88  m_Interpolation = interp;
89  }
90 
91 
92  OutputImagePointer GetSmoothedImage( unsigned int idim,
93  OutputImagePointer image );
94 
95 
102  virtual void GenerateOutputInformation();
103 
110  virtual void GenerateInputRequestedRegion();
111 
112 
113 #ifdef ITK_USE_CONCEPT_CHECKING
114 
115  itkConceptMacro(SameDimensionCheck,
116  (Concept::SameDimension<ImageDimension, OutputImageDimension>));
117  itkConceptMacro(OutputHasNumericTraitsCheck,
118  (Concept::HasNumericTraits<typename TOutputImage::PixelType>));
120 #endif
121 
122 protected:
125  void PrintSelf(std::ostream&os, Indent indent) const;
126 
127  bool m_Verbose;
129 
131 
133  virtual void GenerateData();
134 
135  double m_SamplingFactors[TInputImage::ImageDimension];
136 
137 private:
138  SampleImageFilter(const Self&); //purposely not implemented
139  void operator=(const Self&); //purposely not implemented
140 
141 };
142 
143 
144 } // namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 #include "itkSampleImageFilter.txx"
148 #endif
149 
150 #endif
InterpolationTypeEnum
Definition: itkImageRegistrationFactory.h:79
Superclass::OutputImagePointer OutputImagePointer
Definition: itkSampleImageFilter.h:64
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Superclass::InputImageType InputImageType
Definition: itkSampleImageFilter.h:61
void DebugOff()
Set debugging output off.
Definition: itkSampleImageFilter.h:72
Definition: niftkITKAffineResampleImage.cxx:74
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: itkSampleImageFilter.h:39
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1363
Superclass::InputImageConstPointer InputImageConstPointer
Definition: itkSampleImageFilter.h:65
Filter to sub- or super-sample an image by a certain factor and apply the appropriate blurring (equiv...
Definition: itkSampleImageFilter.h:33
GLdouble GLdouble GLdouble b
Definition: glew.h:7885
Superclass::OutputImageType OutputImageType
Definition: itkSampleImageFilter.h:62
SampleImageFilter Self
Definition: itkSampleImageFilter.h:38
bool m_IsotropicVoxels
Definition: itkSampleImageFilter.h:128
GLuint interp
Definition: glew.h:7062
void SetDebug(bool b)
Set the debugging output.
Definition: itkSampleImageFilter.h:68
bool m_Verbose
Definition: itkSampleImageFilter.h:127
InterpolationTypeEnum m_Interpolation
Definition: itkSampleImageFilter.h:130
SmartPointer< const Self > ConstPointer
Definition: itkSampleImageFilter.h:41
~SampleImageFilter()
Definition: itkSampleImageFilter.h:124
Superclass::InputImagePointer InputImagePointer
Definition: itkSampleImageFilter.h:63
SmartPointer< Self > Pointer
Definition: itkSampleImageFilter.h:40
void DebugOn()
Set debugging output on.
Definition: itkSampleImageFilter.h:70
void SetInterpolationType(InterpolationTypeEnum interp)
Definition: itkSampleImageFilter.h:87