RTK  1.4.0
Reconstruction Toolkit
rtkWarpProjectionStackToFourDImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef rtkWarpProjectionStackToFourDImageFilter_h
19 #define rtkWarpProjectionStackToFourDImageFilter_h
20 
23 
24 #ifdef RTK_USE_CUDA
27 #endif
28 
29 namespace rtk
30 {
83 template< typename VolumeSeriesType, typename ProjectionStackType>
84 class WarpProjectionStackToFourDImageFilter : public rtk::ProjectionStackToFourDImageFilter< VolumeSeriesType, ProjectionStackType>
85 {
86 public:
89  typedef rtk::ProjectionStackToFourDImageFilter< VolumeSeriesType,
90  ProjectionStackType> Superclass;
92 
94  typedef ProjectionStackType VolumeType;
95  typedef itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension - 1> VectorForDVF;
96 
97 #ifdef RTK_USE_CUDA
98  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension> DVFSequenceImageType;
99  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
100 #else
102  typedef itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
103 #endif
104 
106  itkNewMacro(Self)
107 
108 
110 
111  typedef rtk::CyclicDeformationImageFilter<DVFSequenceImageType, DVFImageType> DVFInterpolatorType;
112  typedef std::vector<double> SignalVectorType;
113 
115  void SetBackProjectionFilter (const typename Superclass::BackProjectionFilterType::Pointer itkNotUsed(_arg)) {itkExceptionMacro(<< "BackProjection cannot be changed");}
116 
118  void SetDisplacementField(const DVFSequenceImageType* DVFs);
119  typename DVFSequenceImageType::ConstPointer GetDisplacementField();
121 
122  void SetSignal(const std::vector<double> signal) ITK_OVERRIDE;
123 
125  itkSetMacro(UseCudaCyclicDeformation, bool)
126  itkGetMacro(UseCudaCyclicDeformation, bool)
127 
128 protected:
130  virtual ~WarpProjectionStackToFourDImageFilter() ITK_OVERRIDE {}
131 
133  void GenerateData() ITK_OVERRIDE;
134 
135  void GenerateOutputInformation() ITK_OVERRIDE;
136 
139 #if ITK_VERSION_MAJOR<5
140  void VerifyInputInformation() ITK_OVERRIDE {}
141 #else
142  void VerifyInputInformation() const ITK_OVERRIDE {}
143 #endif
144 
145 
148  std::vector<double> m_Signal;
150 
151 private:
152  WarpProjectionStackToFourDImageFilter(const Self &); //purposely not implemented
153  void operator=(const Self &); //purposely not implemented
154 
155 };
156 } //namespace ITK
157 
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "rtkWarpProjectionStackToFourDImageFilter.hxx"
161 #endif
162 
163 #endif
itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension-1 > DVFImageType
STL namespace.
Return 3D deformation vector field according to input 4D vector field, phase signal and frame number...
void SetBackProjectionFilter(const typename Superclass::BackProjectionFilterType::Pointer)
DVFSequenceImageType::ConstPointer GetDisplacementField()
void SetSignal(const std::vector< double > signal) override
void SetDisplacementField(const DVFSequenceImageType *DVFs)
Implements part of the 4D reconstruction by conjugate gradient.
rtk::ProjectionStackToFourDImageFilter< VolumeSeriesType, ProjectionStackType > Superclass
Back projection part for motion compensated iterative 4D reconstruction.
itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension-1 > VectorForDVF
itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension > DVFSequenceImageType
#define itkSetMacro(name, type)