19 #ifndef rtkIterativeConeBeamReconstructionFilter_h 20 #define rtkIterativeConeBeamReconstructionFilter_h 25 #include "rtkConfiguration.h" 58 template <
class TOutputImage,
class ProjectionStackType = TOutputImage>
78 FP_JOSEPHATTENUATED = 3,
81 } ForwardProjectionType;
86 BP_CUDAVOXELBASED = 2,
88 BP_JOSEPHATTENUATED = 5,
111 return m_CurrentForwardProjectionConfiguration;
114 SetBackProjectionFilter(BackProjectionType bptype);
118 return m_CurrentBackProjectionConfiguration;
128 this->SetNthInput(2, const_cast<VolumeType *>(attenuationMap));
130 typename VolumeType::ConstPointer
144 this->SetInput(
"InferiorClipImage", const_cast<TClipImageType *>(inferiorClipImage));
146 typename TClipImageType::ConstPointer
160 this->SetInput(
"SuperiorClipImage", const_cast<TClipImageType *>(superiorClipImage));
162 typename TClipImageType::ConstPointer
170 itkGetMacro(SigmaZero,
double);
175 itkGetMacro(AlphaPSF,
double);
180 itkGetConstMacro(StepSize,
double);
190 virtual BackProjectionPointerType
191 InstantiateBackProjectionFilter(
int bptype);
195 virtual ForwardProjectionPointerType
196 InstantiateForwardProjectionFilter(
int fwtype);
205 std::default_random_engine m_DefaultRandomEngine = std::default_random_engine{};
208 double m_SigmaZero{ 1.5417233052142099 };
209 double m_AlphaPSF{ 0.016241189545787734 };
212 double m_StepSize{ 1.0 };
217 template <
typename ImageType>
219 !std::is_same_v<CPUImageType, ImageType> &&
220 std::is_same_v<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float> &&
224 template <
typename ImageType>
226 std::is_same_v<CPUImageType, ImageType> ||
227 !std::is_same_v<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float> ||
231 template <
typename ImageType>
233 !std::is_same_v<CPUImageType, ImageType> &&
234 std::is_same_v<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float> &&
236 template <
typename ImageType>
238 std::is_same_v<CPUImageType, ImageType> ||
239 !std::is_same_v<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float> ||
241 template <
typename ImageType>
243 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension != 1>::type;
244 template <
typename ImageType>
246 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension == 1>::type;
249 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
257 ->SetStepSize(m_StepSize);
263 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
264 ForwardProjectionPointerType
267 itkGenericExceptionMacro(
268 <<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
273 template <
typename ImageType, EnableCudaScalarType<ImageType> * =
nullptr>
274 ForwardProjectionPointerType
286 template <
typename ImageType, DisableCudaScalarType<ImageType> * =
nullptr>
287 ForwardProjectionPointerType
290 itkGenericExceptionMacro(
291 <<
"CudaWarpForwardProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
296 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
297 ForwardProjectionPointerType
300 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
305 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
306 ForwardProjectionPointerType
311 if (this->GetAttenuationMap().IsNotNull())
313 fw->SetInput(2, this->GetAttenuationMap());
317 itkExceptionMacro(<<
"Set Joseph attenuated forward projection filter but no attenuation map is given");
320 if (this->GetSuperiorClipImage().IsNotNull())
324 ->SetSuperiorClipImage(this->GetSuperiorClipImage());
326 if (this->GetInferiorClipImage().IsNotNull())
330 ->SetInferiorClipImage(this->GetInferiorClipImage());
335 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
336 ForwardProjectionPointerType
339 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
344 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
345 ForwardProjectionPointerType
350 if (this->GetAttenuationMap().IsNotNull())
352 fw->SetInput(2, this->GetAttenuationMap());
355 ->SetSigmaZero(m_SigmaZero);
357 ->SetAlpha(m_AlphaPSF);
361 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
362 BackProjectionPointerType
373 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
374 BackProjectionPointerType
377 itkGenericExceptionMacro(
378 <<
"CudaBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
383 template <
typename ImageType, EnableCudaScalarType<ImageType> * =
nullptr>
384 BackProjectionPointerType
395 template <
typename ImageType, DisableCudaScalarType<ImageType> * =
nullptr>
396 BackProjectionPointerType
399 itkGenericExceptionMacro(
400 <<
"CudaWarpBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
404 template <
typename ImageType, EnableCudaScalarType<ImageType> * =
nullptr>
405 BackProjectionPointerType
417 template <
typename ImageType, DisableCudaScalarType<ImageType> * =
nullptr>
418 BackProjectionPointerType
421 itkGenericExceptionMacro(<<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float.");
426 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
427 BackProjectionPointerType
430 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
435 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
436 BackProjectionPointerType
441 if (this->GetAttenuationMap().IsNotNull())
443 bp->SetInput(2, this->GetAttenuationMap());
448 itkExceptionMacro(<<
"Set Joseph attenuated backprojection filter but no attenuation map is given");
453 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
454 BackProjectionPointerType
457 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
462 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
463 BackProjectionPointerType
468 if (this->GetAttenuationMap().IsNotNull())
470 bp->SetInput(2, this->GetAttenuationMap());
473 ->SetSigmaZero(m_SigmaZero);
475 ->SetAlpha(m_AlphaPSF);
483 #ifndef ITK_MANUAL_INSTANTIATION 484 # include "rtkIterativeConeBeamReconstructionFilter.hxx"
typename BackProjectionFilterType::Pointer BackProjectionPointerType
Base class for forward projection, i.e. accumulation along x-ray lines.
void SetAttenuationMap(const VolumeType *attenuationMap)
TClipImageType::ConstPointer GetSuperiorClipImage()
ForwardProjectionPointerType InstantiateJosephForwardAttenuatedProjection()
VolumeType::ConstPointer GetAttenuationMap()
typename ForwardProjectionFilterType::Pointer ForwardProjectionPointerType
DataObject * GetInput(const DataObjectIdentifierType &key)
void SetSuperiorClipImage(const TClipImageType *superiorClipImage)
typename std::enable_if< itk::PixelTraits< typename ImageType::PixelType >::Dimension==1 >::type DisableVectorType
ForwardProjectionType m_CurrentForwardProjectionConfiguration
BackProjectionPointerType InstantiateCudaBackProjection()
Cuda version of the backprojection.
Joseph forward projection.
typename std::enable_if< std::is_same_v< CPUImageType, ImageType >||!std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >||(itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 &&itk::PixelTraits< typename ImageType::PixelType >::Dimension !=2 &&itk::PixelTraits< typename ImageType::PixelType >::Dimension !=3)>::type DisableCudaScalarAndVectorType
TClipImageType::ConstPointer GetInferiorClipImage()
typename std::enable_if< std::is_same_v< CPUImageType, ImageType >||!std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >||itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 >::type DisableCudaScalarType
#define itkSetMacro(name, type)
BackProjectionPointerType InstantiateCudaRayCastBackProjection()
ForwardProjectionType GetForwardProjectionFilter()
void SetInferiorClipImage(const TClipImageType *inferiorClipImage)
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
BackProjectionType m_CurrentBackProjectionConfiguration
typename std::enable_if< !std::is_same_v< CPUImageType, ImageType > &&std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float > &&(itk::PixelTraits< typename ImageType::PixelType >::Dimension==1||itk::PixelTraits< typename ImageType::PixelType >::Dimension==2||itk::PixelTraits< typename ImageType::PixelType >::Dimension==3)>::type EnableCudaScalarAndVectorType
ForwardProjectionPointerType InstantiateCudaWarpForwardProjection()
ForwardProjectionPointerType InstantiateCudaForwardProjection()
BackProjectionPointerType InstantiateZengBackProjection()
BackProjectionPointerType InstantiateJosephBackAttenuatedProjection()
typename std::enable_if< itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 >::type EnableVectorType
BackProjectionPointerType InstantiateCudaWarpBackProjection()
typename std::enable_if< !std::is_same_v< CPUImageType, ImageType > &&std::is_same_v< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float > &&itk::PixelTraits< typename ImageType::PixelType >::Dimension==1 >::type EnableCudaScalarType
ForwardProjectionPointerType InstantiateZengForwardProjection()
BackProjectionType GetBackProjectionFilter()