RTK  2.6.0
Reconstruction Toolkit
rtkMotionCompensatedFourDConjugateGradientConeBeamReconstructionFilter.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 
19 #ifndef rtkMotionCompensatedFourDConjugateGradientConeBeamReconstructionFilter_h
20 #define rtkMotionCompensatedFourDConjugateGradientConeBeamReconstructionFilter_h
21 
25 #ifdef RTK_USE_CUDA
28 #endif
29 
30 namespace rtk
31 {
69 template <typename VolumeSeriesType, typename ProjectionStackType>
71  : public rtk::FourDConjugateGradientConeBeamReconstructionFilter<VolumeSeriesType, ProjectionStackType>
72 {
73 public:
75 
81 
83  using InputImageType = VolumeSeriesType;
84  using OutputImageType = VolumeSeriesType;
85  using VolumeType = ProjectionStackType;
86  using VectorForDVF = itk::CovariantVector<typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension - 1>;
87 
88  using ForwardProjectionType = typename Superclass::ForwardProjectionType;
89  using BackProjectionType = typename Superclass::BackProjectionType;
90 
92  using CPUVolumeSeriesType =
94 #ifdef RTK_USE_CUDA
95  typedef typename std::conditional<std::is_same<VolumeSeriesType, CPUVolumeSeriesType>::value,
97  itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension>>::type
99  typedef
100  typename std::conditional<std::is_same<VolumeSeriesType, CPUVolumeSeriesType>::value,
101  itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1>,
102  itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension - 1>>::type DVFImageType;
103 #else
105  using DVFImageType = itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1>;
106 #endif
107 
111  itkNewMacro(Self);
112 
115 
117  void
119  {
120  itkExceptionMacro(<< "ForwardProjection cannot be changed");
121  }
122  void
123  SetBackProjectionFilter(BackProjectionType itkNotUsed(_arg)) override
124  {
125  itkExceptionMacro(<< "BackProjection cannot be changed");
126  }
128 
130  void
131  SetDisplacementField(const DVFSequenceImageType * DisplacementField);
132  void
133  SetInverseDisplacementField(const DVFSequenceImageType * InverseDisplacementField);
134  typename DVFSequenceImageType::ConstPointer
135  GetDisplacementField();
136  typename DVFSequenceImageType::ConstPointer
137  GetInverseDisplacementField();
139 
141  void
142  SetSignal(const std::vector<double> signal) override;
143 
144  // Sub filters type alias
146  using MCCGOperatorType =
148 
150  itkSetMacro(UseCudaCyclicDeformation, bool);
151  itkGetMacro(UseCudaCyclicDeformation, bool);
153 
154 protected:
157 
158  void
159  GenerateOutputInformation() override;
160  void
161  GenerateInputRequestedRegion() override;
162 
164 
165 }; // end of class
166 
167 } // end namespace rtk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 # include "rtkMotionCompensatedFourDConjugateGradientConeBeamReconstructionFilter.hxx"
171 #endif
172 
173 #endif
typename itk::Image< typename VolumeSeriesType::PixelType, VolumeSeriesType::ImageDimension > CPUVolumeSeriesType
#define itkSetMacro(name, type)
TOutputImage OutputImageType
Back projection part for motion compensated iterative 4D reconstruction.
Implements part of the 4D reconstruction by conjugate gradient.