RTK  1.4.0
Reconstruction Toolkit
rtkWarpFourDToProjectionStackImageFilter.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 rtkWarpFourDToProjectionStackImageFilter_h
19 #define rtkWarpFourDToProjectionStackImageFilter_h
20 
24 #include <vector>
25 
26 #ifdef RTK_USE_CUDA
29 #endif
30 
31 namespace rtk
32 {
85  template< typename VolumeSeriesType, typename ProjectionStackType>
86 class WarpFourDToProjectionStackImageFilter : public rtk::FourDToProjectionStackImageFilter<ProjectionStackType, VolumeSeriesType>
87 {
88 public:
91  typedef rtk::FourDToProjectionStackImageFilter< ProjectionStackType,
92  VolumeSeriesType> Superclass;
94 
96  typedef ProjectionStackType VolumeType;
97  typedef itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension - 1> VectorForDVF;
98 
99 #ifdef RTK_USE_CUDA
100  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension> DVFSequenceImageType;
101  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
102 #else
104  typedef itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
105 #endif
106 
108  itkNewMacro(Self)
109 
110 
112 
113  typedef rtk::CyclicDeformationImageFilter<DVFSequenceImageType, DVFImageType> DVFInterpolatorType;
114  typedef std::vector<double> SignalVectorType;
115 
117  void SetForwardProjectionFilter (const typename Superclass::ForwardProjectionFilterType::Pointer itkNotUsed(_arg)) {itkExceptionMacro(<< "ForwardProjection cannot be changed");}
118 
120  void SetDisplacementField(const DVFSequenceImageType* DVFs);
121  typename DVFSequenceImageType::ConstPointer GetDisplacementField();
123 
124  void SetSignal(const std::vector<double> signal) ITK_OVERRIDE;
125 
127  itkSetMacro(UseCudaCyclicDeformation, bool)
128  itkGetMacro(UseCudaCyclicDeformation, bool)
129 
130 protected:
132  virtual ~WarpFourDToProjectionStackImageFilter() ITK_OVERRIDE {}
133 
135  void GenerateData() ITK_OVERRIDE;
136 
137  void GenerateOutputInformation() ITK_OVERRIDE;
138 
139  void GenerateInputRequestedRegion() ITK_OVERRIDE;
140 
143 #if ITK_VERSION_MAJOR<5
144  void VerifyInputInformation() ITK_OVERRIDE {}
145 #else
146  void VerifyInputInformation() const ITK_OVERRIDE {}
147 #endif
148 
149 
152  std::vector<double> m_Signal;
154 
155 private:
156  WarpFourDToProjectionStackImageFilter(const Self &); //purposely not implemented
157  void operator=(const Self &); //purposely not implemented
158 
159 };
160 } //namespace ITK
161 
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "rtkWarpFourDToProjectionStackImageFilter.hxx"
165 #endif
166 
167 #endif
Base class for forward projection, i.e. accumulation along x-ray lines.
itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension-1 > VectorForDVF
itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension > DVFSequenceImageType
void SetForwardProjectionFilter(const typename Superclass::ForwardProjectionFilterType::Pointer)
STL namespace.
Return 3D deformation vector field according to input 4D vector field, phase signal and frame number...
void SetDisplacementField(const DVFSequenceImageType *DVFs)
rtk::FourDToProjectionStackImageFilter< ProjectionStackType, VolumeSeriesType > Superclass
void SetSignal(const std::vector< double > signal) override
Forward projection part for motion compensated iterative 4D reconstruction.
Implements part of the 4D reconstruction by conjugate gradient.
DVFSequenceImageType::ConstPointer GetDisplacementField()
itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension-1 > DVFImageType
#define itkSetMacro(name, type)