RTK  1.4.0
Reconstruction Toolkit
rtkMotionCompensatedFourDReconstructionConjugateGradientOperator.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 rtkMotionCompensatedFourDReconstructionConjugateGradientOperator_h
19 #define rtkMotionCompensatedFourDReconstructionConjugateGradientOperator_h
20 
23 
24 #ifdef RTK_USE_CUDA
28 #endif
29 
30 namespace rtk
31 {
94 template< typename VolumeSeriesType, typename ProjectionStackType>
96 {
97 public:
102 
104  typedef ProjectionStackType VolumeType;
105  typedef itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension - 1> VectorForDVF;
106 
107 #ifdef RTK_USE_CUDA
108  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension> DVFSequenceImageType;
109  typedef itk::CudaImage<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
110 #else
112  typedef itk::Image<VectorForDVF, VolumeSeriesType::ImageDimension - 1> DVFImageType;
113 #endif
114 
116  itkNewMacro(Self)
117 
118 
120 
121  typedef rtk::CyclicDeformationImageFilter<DVFSequenceImageType, DVFImageType> DVFInterpolatorType;
122 
124  void SetForwardProjectionFilter (const typename Superclass::ForwardProjectionFilterType::Pointer itkNotUsed(_arg)) {itkExceptionMacro(<< "ForwardProjection cannot be changed");}
125  void SetBackProjectionFilter (const typename Superclass::BackProjectionFilterType::Pointer itkNotUsed(_arg)) {itkExceptionMacro(<< "BackProjection cannot be changed");}
127 
129  void SetDisplacementField(const DVFSequenceImageType* DVFs);
130  void SetInverseDisplacementField(const DVFSequenceImageType* DVFs);
131  typename DVFSequenceImageType::ConstPointer GetInverseDisplacementField();
132  typename DVFSequenceImageType::ConstPointer GetDisplacementField();
134 
136  void SetSignal(const std::vector<double> signal) ITK_OVERRIDE;
137 
139  itkSetMacro(UseCudaCyclicDeformation, bool)
140  itkGetMacro(UseCudaCyclicDeformation, bool)
141 
142 protected:
145 
147  void GenerateOutputInformation() ITK_OVERRIDE;
148 
150 #if ITK_VERSION_MAJOR<5
151  void VerifyInputInformation() ITK_OVERRIDE {}
152 #else
153  void VerifyInputInformation() const ITK_OVERRIDE {}
154 #endif
155 
156 
158  void GenerateData() ITK_OVERRIDE;
159 
163  std::vector<double> m_Signal;
165 
166 private:
167  MotionCompensatedFourDReconstructionConjugateGradientOperator(const Self &); //purposely not implemented
168  void operator=(const Self &); //purposely not implemented
169 };
170 } //namespace ITK
171 
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 #include "rtkMotionCompensatedFourDReconstructionConjugateGradientOperator.hxx"
175 #endif
176 
177 #endif
Base class for forward projection, i.e. accumulation along x-ray lines.
void SetInverseDisplacementField(const DVFSequenceImageType *DVFs)
FourDReconstructionConjugateGradientOperator< VolumeSeriesType, ProjectionStackType > Superclass
DVFSequenceImageType::ConstPointer GetInverseDisplacementField()
Return 3D deformation vector field according to input 4D vector field, phase signal and frame number...
void SetDisplacementField(const DVFSequenceImageType *DVFs)
Implements part of the 4D reconstruction by conjugate gradient.
void SetSignal(const std::vector< double > signal) override
itk::CovariantVector< typename VolumeSeriesType::ValueType, VolumeSeriesType::ImageDimension-1 > VectorForDVF
#define itkSetMacro(name, type)