NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkAddUpdateToTimeVaryingVelocityFieldFilter.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 itkAddUpdateToTimeVaryingVelocityFieldFilter_h
16 #define itkAddUpdateToTimeVaryingVelocityFieldFilter_h
17 
18 #include <itkVector.h>
19 #include <itkImage.h>
20 #include <itkInPlaceImageFilter.h>
21 
22 namespace itk {
23 
35 template < typename TScalarType, unsigned int NDimensions = 3>
37 public InPlaceImageFilter<
38  Image< Vector<TScalarType, NDimensions>, NDimensions + 1>, // Input image is time varying velocity field.
39  Image< Vector<TScalarType, NDimensions>, NDimensions + 1> // Output image is time varying velocity field.
40  >
41 {
42 
43 public:
44 
47  typedef ImageToImageFilter<Image< Vector<TScalarType, NDimensions>, NDimensions + 1>,
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(AddUpdateToTimeVaryingVelocityFieldFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(Dimension, unsigned int, NDimensions);
61 
63  typedef Vector< TScalarType, NDimensions > TimeVaryingVelocityPixelType;
68  typedef typename TimeVaryingVelocityImageType::PointType TimeVaryingVelocityPointType;
69  typedef typename TimeVaryingVelocityImageType::SpacingType TimeVaryingVelocitySpacingType;
70  typedef typename TimeVaryingVelocityImageType::DirectionType TimeVaryingVelocityDirectionType;
71 
72  typedef Vector< TScalarType, NDimensions > UpdatePixelType;
74  typedef typename UpdateImageType::Pointer UpdateImagePointer;
78  typedef typename UpdateImageType::PointType UpdateImagePointType;
79  typedef typename UpdateImageType::SpacingType UpdateImageSpacingType;
80  typedef typename UpdateImageType::DirectionType UpdateImageDirectionType;
81 
83  itkSetMacro(TimePoint, float);
84  itkGetMacro(TimePoint, float);
85 
87  itkSetMacro(ScaleFactor, float);
88  itkGetMacro(ScaleFactor, float);
89 
91  itkSetMacro(OverWrite, bool);
92  itkGetMacro(OverWrite, bool);
93 
95  void SetUpdateImage(UpdateImageType* i) { m_UpdateImage = i; }
96 
98  void SetUpdateInverseImage(UpdateImageType *i) { m_UpdateInverseImage = i; }
99 
101  itkGetMacro(MaxDeformation, float);
102 
103 protected:
104 
107  void PrintSelf(std::ostream& os, Indent indent) const;
108 
109  // Called before threaded bit.
110  virtual void BeforeThreadedGenerateData();
111 
112  // Called after threaded bit.
113  virtual void AfterThreadedGenerateData();
114 
115  // The main method to implement in derived classes, note, its threaded.
116  virtual void ThreadedGenerateData(const TimeVaryingVelocityRegionType &regionForThread, ThreadIdType threadId);
117 
118 private:
119 
121  bool m_OverWrite;
122 
124  float m_TimePoint;
125 
127  float m_ScaleFactor;
128 
130  float m_MaxDeformation;
131 
133  UpdateImagePointer m_UpdateImage;
134 
136  UpdateImagePointer m_UpdateInverseImage;
137 
138 }; // end class
139 
140 } // end namespace
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkAddUpdateToTimeVaryingVelocityFieldFilter.txx"
144 #endif
145 
146 #endif
Image< UpdatePixelType, NDimensions > UpdateImageType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:73
TimeVaryingVelocityImageType::PointType TimeVaryingVelocityPointType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:68
UpdateImageType::Pointer UpdateImagePointer
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:74
TimeVaryingVelocityImageType::DirectionType TimeVaryingVelocityDirectionType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:70
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
Adds a vector displacement field to a time varying velocity field.
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:36
Vector< TScalarType, NDimensions > TimeVaryingVelocityPixelType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:63
TimeVaryingVelocityImageType::SizeType TimeVaryingVelocitySizeType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:67
void SetUpdateInverseImage(UpdateImageType *i)
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:98
SmartPointer< const Self > ConstPointer
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:51
UpdateImageType::DirectionType UpdateImageDirectionType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:80
UpdateImageType::IndexType UpdateImageIndexType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:76
UpdateImageType::PointType UpdateImagePointType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:78
TimeVaryingVelocityImageType::SpacingType TimeVaryingVelocitySpacingType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:69
TimeVaryingVelocityImageType::IndexType TimeVaryingVelocityIndexType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:66
Vector< TScalarType, NDimensions > UpdatePixelType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:72
Definition: niftkITKAffineResampleImage.cxx:74
UpdateImageType::RegionType UpdateImageRegionType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:75
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
void SetUpdateImage(UpdateImageType *i)
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:95
AddUpdateToTimeVaryingVelocityFieldFilter Self
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:46
ImageToImageFilter< Image< Vector< TScalarType, NDimensions >, NDimensions+1 >, Image< Vector< TScalarType, NDimensions >, NDimensions+1 > > Superclass
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:49
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
Image< TimeVaryingVelocityPixelType, NDimensions+1 > TimeVaryingVelocityImageType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:64
SmartPointer< Self > Pointer
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:50
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
UpdateImageType::SizeType UpdateImageSizeType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:77
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
UpdateImageType::SpacingType UpdateImageSpacingType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:79
TimeVaryingVelocityImageType::RegionType TimeVaryingVelocityRegionType
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:65
~AddUpdateToTimeVaryingVelocityFieldFilter()
Definition: itkAddUpdateToTimeVaryingVelocityFieldFilter.h:106