NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkFluidVelocityToDeformationFilter.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 itkFluidVelocityToDeformationFilter_h
16 #define itkFluidVelocityToDeformationFilter_h
17 
18 #include <itkVector.h>
19 #include <itkImage.h>
20 #include <itkImageToImageFilter.h>
21 
22 
26 class FluidVelocityToDeformationFilterUnitTest;
27 
28 namespace itk {
35 template <
36  class TScalarType = double, // Data type for scalars
37  unsigned int NDimensions = 3> // Number of Dimensions i.e. 2D or 3D
39  public ImageToImageFilter< Image< Vector<TScalarType, NDimensions>, NDimensions>, // Input image
40  Image< Vector<TScalarType, NDimensions>, NDimensions> // Output image
41  >
42 {
43 public:
44 
47  typedef ImageToImageFilter< Image< Vector<TScalarType, NDimensions>, NDimensions>,
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(FluidVelocityToDeformationFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(Dimension, unsigned int, NDimensions);
61 
63  typedef Vector< TScalarType, itkGetStaticConstMacro(Dimension) > OutputPixelType;
65  typedef typename Superclass::InputImageType InputImageType;
66  typedef typename Superclass::InputImagePointer InputImagePointer;
67  typedef typename Superclass::InputImageRegionType InputImageRegionType;
69 
71  virtual void SetCurrentDeformationField(const InputImageType *image) { this->SetNthInput(0, image); }
72 
74  virtual void SetVelocityField(const InputImageType *image) { this->SetNthInput(1, image); }
75 
77  virtual void SetNthInput(unsigned int idx, const InputImageType *);
78 
82  virtual void SetInputMask(const InputImageMaskType* inputImageMask) { this->m_InputMask = inputImageMask; }
83 
85  itkGetMacro(MaxDeformation, double);
86 
90  itkSetMacro(IsNegativeVelocity, bool);
91  itkGetMacro(IsNegativeVelocity, bool);
92  itkSetMacro(IsTakeDerivative, bool);
93 
94 protected:
97  void PrintSelf(std::ostream& os, Indent indent) const;
98 
99  // Check before we start.
100  virtual void BeforeThreadedGenerateData();
101 
102  // The main method to implement in derived classes, note, its threaded.
103  virtual void ThreadedGenerateData( const InputImageRegionType &outputRegionForThread, ThreadIdType threadId);
104 
108  virtual void AfterThreadedGenerateData();
109 
112 
117 
121  const InputImageMaskType* m_InputMask;
122 
127 
128 private:
129 
133  FluidVelocityToDeformationFilter(const Self&);
134  void operator=(const Self&);
135 
139  friend class ::FluidVelocityToDeformationFilterUnitTest;
140 
141 };
142 
143 } // end namespace
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkFluidVelocityToDeformationFilter.txx"
147 #endif
148 
149 #endif
FluidVelocityToDeformationFilter Self
Definition: itkFluidVelocityToDeformationFilter.h:46
Image< float, Dimension > InputImageMaskType
Definition: itkFluidVelocityToDeformationFilter.h:68
virtual ~FluidVelocityToDeformationFilter()
Definition: itkFluidVelocityToDeformationFilter.h:96
Superclass::InputImagePointer InputImagePointer
Definition: itkFluidVelocityToDeformationFilter.h:66
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
This class takes two inputs, the first is the current deformation vector field and the second is the ...
Definition: itkFluidVelocityToDeformationFilter.h:38
double m_MaxDeformation
Definition: itkFluidVelocityToDeformationFilter.h:111
Definition: niftkITKAffineResampleImage.cxx:74
virtual void SetCurrentDeformationField(const InputImageType *image)
Definition: itkFluidVelocityToDeformationFilter.h:71
ImageToImageFilter< Image< Vector< TScalarType, NDimensions >, NDimensions >, Image< Vector< TScalarType, NDimensions >, NDimensions > > Superclass
Definition: itkFluidVelocityToDeformationFilter.h:49
Image< OutputPixelType, itkGetStaticConstMacro(Dimension) > OutputImageType
Definition: itkFluidVelocityToDeformationFilter.h:64
virtual void SetInputMask(const InputImageMaskType *inputImageMask)
Definition: itkFluidVelocityToDeformationFilter.h:82
Superclass::InputImageType InputImageType
Definition: itkFluidVelocityToDeformationFilter.h:65
SmartPointer< Self > Pointer
Definition: itkFluidVelocityToDeformationFilter.h:50
SmartPointer< const Self > ConstPointer
Definition: itkFluidVelocityToDeformationFilter.h:51
Superclass::InputImageRegionType InputImageRegionType
Definition: itkFluidVelocityToDeformationFilter.h:67
const InputImageMaskType * m_InputMask
Definition: itkFluidVelocityToDeformationFilter.h:121
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
bool m_IsNegativeVelocity
Definition: itkFluidVelocityToDeformationFilter.h:116
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
bool m_IsTakeDerivative
Definition: itkFluidVelocityToDeformationFilter.h:126
virtual void SetVelocityField(const InputImageType *image)
Definition: itkFluidVelocityToDeformationFilter.h:74
Vector< TScalarType, itkGetStaticConstMacro(Dimension) > OutputPixelType
Definition: itkFluidVelocityToDeformationFilter.h:63