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 
101  using CPUVolumeSeriesType =
103 #ifdef RTK_USE_CUDA
104  using DVFSequenceImageType =
105  typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
107  itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension>>;
108  using DVFImageType = typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
109  itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1>,
110  itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension - 1>>;
112  typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
117  typename std::conditional_t<std::is_same_v<VolumeSeriesType, CPUVolumeSeriesType>,
120 #else
122  using DVFImageType = itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1>;
126 #endif
127 
129  itkNewMacro(Self);
130 
132  itkOverrideGetNameOfClassMacro(WarpProjectionStackToFourDImageFilter);
133 
134  using SignalVectorType = std::vector<double>;
135 
137  void
138  SetBackProjectionFilter(typename Superclass::BackProjectionFilterType * itkNotUsed(_arg))
139  {
140  itkExceptionMacro(<< "BackProjection cannot be changed");
141  }
142 
144  void
145  SetDisplacementField(const DVFSequenceImageType * DisplacementField);
146  typename DVFSequenceImageType::ConstPointer
147  GetDisplacementField();
149 
150  void
151  SetSignal(const std::vector<double> signal) override;
152 
154  itkSetMacro(UseCudaCyclicDeformation, bool);
155  itkGetMacro(UseCudaCyclicDeformation, bool);
157 
158 protected:
160  ~WarpProjectionStackToFourDImageFilter() override = default;
161 
163  void
164  GenerateData() override;
165 
166  void
167  GenerateOutputInformation() override;
168 
171  void
172  VerifyInputInformation() const override
173  {}
174 
177  std::vector<double> m_Signal;
179 };
180 } // namespace rtk
181 
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 # include "rtkWarpProjectionStackToFourDImageFilter.hxx"
185 #endif
186 
187 #endif
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
typename std::conditional_t< std::is_same_v< VolumeSeriesType, CPUVolumeSeriesType >, itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension - 1 >, itk::CudaImage< VectorForDVF, VolumeSeriesType::ImageDimension - 1 > > DVFImageType
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 std::conditional_t< std::is_same_v< VolumeSeriesType, CPUVolumeSeriesType >, itk::Image< VectorForDVF, VolumeSeriesType::ImageDimension >, itk::CudaImage< VectorForDVF, VolumeSeriesType::ImageDimension > > DVFSequenceImageType
Back projection part for motion compensated iterative 4D reconstruction.
typename itk::Image< typename VolumeSeriesType::PixelType, VolumeSeriesType::ImageDimension > CPUVolumeSeriesType