RTK  2.7.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  * https://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 {
84 template <typename VolumeSeriesType, typename ProjectionStackType>
85 class ITK_TEMPLATE_EXPORT WarpProjectionStackToFourDImageFilter
86  : public ProjectionStackToFourDImageFilter<VolumeSeriesType, ProjectionStackType>
87 {
88 public:
89  ITK_DISALLOW_COPY_AND_MOVE(WarpProjectionStackToFourDImageFilter);
90 
95 
97  using VolumeType = ProjectionStackType;
98  using VectorForDVF = itk::CovariantVector<typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension - 1>;
99  using CPUVolumeSeriesType =
101  using DVFSequenceImageType =
102  typename VolumeSeriesType::template RebindImageType<VectorForDVF, VolumeSeriesType::ImageDimension>;
103  using DVFImageType =
104  typename VolumeSeriesType::template RebindImageType<VectorForDVF, VolumeSeriesType::ImageDimension - 1>;
105 
107 #ifdef RTK_USE_CUDA
109  typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
114  typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
117 #else
121 #endif
122 
124  itkNewMacro(Self);
125 
127  itkOverrideGetNameOfClassMacro(WarpProjectionStackToFourDImageFilter);
128 
129  using SignalVectorType = std::vector<double>;
130 
132  void
133  SetBackProjectionFilter(typename Superclass::BackProjectionFilterType * itkNotUsed(_arg))
134  {
135  itkExceptionMacro(<< "BackProjection cannot be changed");
136  }
137 
139  void
140  SetDisplacementField(const DVFSequenceImageType * DisplacementField);
141  typename DVFSequenceImageType::ConstPointer
142  GetDisplacementField();
144 
145  void
146  SetSignal(const std::vector<double> signal) override;
147 
149  itkSetMacro(UseCudaCyclicDeformation, bool);
150  itkGetMacro(UseCudaCyclicDeformation, bool);
152 
153 protected:
155  ~WarpProjectionStackToFourDImageFilter() override = default;
156 
158  void
159  GenerateData() override;
160 
161  void
162  GenerateOutputInformation() override;
163 
166  void
167  VerifyInputInformation() const override
168  {}
169 
172  std::vector<double> m_Signal;
174 };
175 } // namespace rtk
176 
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
179 # include "rtkWarpProjectionStackToFourDImageFilter.hxx"
180 #endif
181 
182 #endif
typename VolumeSeriesType::template RebindImageType< VectorForDVF, VolumeSeriesType::ImageDimension > DVFSequenceImageType
void SetBackProjectionFilter(typename Superclass::BackProjectionFilterType *)
Return 3D deformation vector field according to input 4D vector field, phase signal and frame number...
typename std::conditional_t< std::is_same_v< VolumeSeriesType, CPUVolumeSeriesType >, CPUDVFInterpolatorType, CudaCyclicDeformationImageFilter > CudaCyclicDeformationImageFilterType
Voxel-based backprojection into warped volume implemented in CUDA.
#define itkSetMacro(name, type)
typename std::conditional_t< std::is_same_v< VolumeSeriesType, CPUVolumeSeriesType >, BackProjectionImageFilter< VolumeType, VolumeType >, CudaWarpBackProjectionImageFilter > WarpBackProjectionImageFilter
Implements part of the 4D reconstruction by conjugate gradient.
GPU version of the temporal DVF interpolator.
typename VolumeSeriesType::template RebindImageType< VectorForDVF, VolumeSeriesType::ImageDimension - 1 > DVFImageType
Back projection part for motion compensated iterative 4D reconstruction.
typename itk::Image< typename VolumeSeriesType::PixelType, VolumeSeriesType::ImageDimension > CPUVolumeSeriesType