NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkDasGradientFilter.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 itkDasGradientFilter_h
16 #define itkDasGradientFilter_h
17 
18 #include <itkVector.h>
19 #include <itkImage.h>
20 #include <itkImageToImageFilter.h>
21 #include <itkLinearInterpolateImageFunction.h>
22 #include <itkVectorLinearInterpolateImageFunction.h>
23 #include <itkImageFileWriter.h>
25 
26 namespace itk {
44 template < typename TScalarType, unsigned int NDimensions = 3>
45 class ITK_EXPORT DasGradientFilter :
46 public ImageToImageFilter<
47  Image< TScalarType, NDimensions>, // Input image
48  Image< Vector<TScalarType, NDimensions>, NDimensions> // Output image
49  >
50 {
51  public:
52 
55  typedef ImageToImageFilter<
56  Image< TScalarType,
57  NDimensions>,
59  NDimensions>
61  typedef SmartPointer<Self> Pointer;
62  typedef SmartPointer<const Self> ConstPointer;
63 
68  typedef Vector< TScalarType, NDimensions > VectorPixelType;
70  typedef VectorPixelType OutputPixelType;
71  typedef VectorImageType OutputImageType;
72  typedef VectorLinearInterpolateImageFunction <VectorImageType,
73  TScalarType > VectorInterpolatorType;
74  typedef LinearInterpolateImageFunction< InputImageType, TScalarType > LinearInterpolatorType;
76  TScalarType> GradientFilterType;
78 
80  itkNewMacro(Self);
81 
83  itkTypeMacro(DasGradientFilter, ImageToImageFilter);
84 
86  itkStaticConstMacro(Dimension, unsigned int, NDimensions);
87 
89  void SetTransformation(VectorImageType* image) { m_PhiTransformation = image; }
90 
92  itkSetMacro(ReverseGradient, bool);
93  itkGetMacro(ReverseGradient, bool);
94 
99  itkSetMacro(UseGradientTransformedMovingImage, bool);
100  itkGetMacro(UseGradientTransformedMovingImage, bool);
101 
102  protected:
105  void PrintSelf(std::ostream& os, Indent indent) const;
106 
107  // Before we start multi-threaded section.
108  virtual void BeforeThreadedGenerateData();
109 
110  // The main method to implement in derived classes, note, its threaded.
111  virtual void ThreadedGenerateData( const InputImageRegionType &outputRegionForThread, ThreadIdType threadId);
112 
113  private:
114 
118  DasGradientFilter(const Self&);
119  void operator=(const Self&);
120 
122  typename VectorImageType::Pointer m_PhiTransformation;
123 
125  typename LinearInterpolatorType::Pointer m_ThicknessInterpolator;
126 
128  typename LinearInterpolatorType::Pointer m_WhiteMatterInterpolator;
129 
131  typename VectorInterpolatorType::Pointer m_GradientInterpolator;
132 
134  typename GradientFilterType::Pointer m_GradientFilter;
135 
137  typename TransformImageFilterType::Pointer m_TransformImageFilter;
138 
140  bool m_ReverseGradient;
141 
143  bool m_UseGradientTransformedMovingImage;
144 
146  bool m_GradientFilterInitialized;
147 
148 }; // end class
149 
150 } // end namespace
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkDasGradientFilter.txx"
154 #endif
155 
156 #endif
void SetTransformation(VectorImageType *image)
Definition: itkDasGradientFilter.h:89
ScalarImageToNormalizedGradientVectorImageFilter< InputImageType, TScalarType > GradientFilterType
Definition: itkDasGradientFilter.h:76
Image< VectorPixelType, NDimensions > VectorImageType
Definition: itkDasGradientFilter.h:69
ImageToImageFilter< Image< TScalarType, NDimensions >, Image< Vector< TScalarType, NDimensions >, NDimensions > > Superclass
Definition: itkDasGradientFilter.h:60
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
VectorImageType OutputImageType
Definition: itkDasGradientFilter.h:71
DasGradientFilter Self
Definition: itkDasGradientFilter.h:54
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
Image< TScalarType, NDimensions > InputImageType
Definition: itkDasGradientFilter.h:65
InputImageType::RegionType InputImageRegionType
Definition: itkDasGradientFilter.h:67
VectorLinearInterpolateImageFunction< VectorImageType, TScalarType > VectorInterpolatorType
Definition: itkDasGradientFilter.h:73
SmartPointer< const Self > ConstPointer
Definition: itkDasGradientFilter.h:62
This class calculates the gradient as per equation 3 in Das et. al. Neuroimage 45 (2009) 867-879...
Definition: itkDasGradientFilter.h:45
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
~DasGradientFilter()
Definition: itkDasGradientFilter.h:104
Transform an image using a vector field, where each vector represents the absolute sampling position...
Definition: itkDasTransformImageFilter.h:33
LinearInterpolateImageFunction< InputImageType, TScalarType > LinearInterpolatorType
Definition: itkDasGradientFilter.h:74
DasTransformImageFilter< TScalarType, NDimensions > TransformImageFilterType
Definition: itkDasGradientFilter.h:77
SmartPointer< Self > Pointer
Definition: itkDasGradientFilter.h:61
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
Vector< TScalarType, NDimensions > VectorPixelType
Definition: itkDasGradientFilter.h:68
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
This class takes scalar image as input, and outputs a vector field of image gradient.
Definition: itkScalarImageToNormalizedGradientVectorImageFilter.h:67
InputImageType::IndexType InputImageIndexType
Definition: itkDasGradientFilter.h:66
VectorPixelType OutputPixelType
Definition: itkDasGradientFilter.h:70