19 #ifndef rtkIterativeConeBeamReconstructionFilter_h 20 #define rtkIterativeConeBeamReconstructionFilter_h 25 #include "rtkConfiguration.h" 56 template <
class TOutputImage,
class ProjectionStackType = TOutputImage>
76 FP_JOSEPHATTENUATED = 3,
78 } ForwardProjectionType;
83 BP_CUDAVOXELBASED = 2,
85 BP_JOSEPHATTENUATED = 5,
99 #ifdef itkOverrideGetNameOfClassMacro 112 return m_CurrentForwardProjectionConfiguration;
115 SetBackProjectionFilter(BackProjectionType bptype);
119 return m_CurrentBackProjectionConfiguration;
129 this->SetNthInput(2, const_cast<VolumeType *>(attenuationMap));
131 typename VolumeType::ConstPointer
145 this->SetInput(
"InferiorClipImage", const_cast<TClipImageType *>(inferiorClipImage));
147 typename TClipImageType::ConstPointer
161 this->SetInput(
"SuperiorClipImage", const_cast<TClipImageType *>(superiorClipImage));
163 typename TClipImageType::ConstPointer
171 itkGetMacro(SigmaZero,
double);
176 itkGetMacro(AlphaPSF,
double);
181 itkGetConstMacro(StepSize,
double);
191 virtual BackProjectionPointerType
192 InstantiateBackProjectionFilter(
int bptype);
196 virtual ForwardProjectionPointerType
197 InstantiateForwardProjectionFilter(
int fwtype);
206 std::default_random_engine m_DefaultRandomEngine = std::default_random_engine{};
209 double m_SigmaZero{ 1.5417233052142099 };
210 double m_AlphaPSF{ 0.016241189545787734 };
213 double m_StepSize{ 1.0 };
218 template <
typename ImageType>
220 !std::is_same<CPUImageType, ImageType>::value &&
221 std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value &&
225 template <
typename ImageType>
227 std::is_same<CPUImageType, ImageType>::value ||
228 !std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value ||
232 template <
typename ImageType>
234 !std::is_same<CPUImageType, ImageType>::value &&
235 std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value &&
237 template <
typename ImageType>
239 std::is_same<CPUImageType, ImageType>::value ||
240 !std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value ||
242 template <
typename ImageType>
244 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension != 1>::type;
245 template <
typename ImageType>
247 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension == 1>::type;
250 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
256 fw = CudaForwardProjectionImageFilter<ImageType, ImageType>::New();
257 dynamic_cast<rtk::CudaForwardProjectionImageFilter<ImageType, ImageType> *
>(fw.GetPointer())
258 ->SetStepSize(m_StepSize);
264 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
265 ForwardProjectionPointerType
268 itkGenericExceptionMacro(
269 <<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
274 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
275 ForwardProjectionPointerType
278 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
283 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
284 ForwardProjectionPointerType
289 if (this->GetAttenuationMap().IsNotNull())
291 fw->SetInput(2, this->GetAttenuationMap());
295 itkExceptionMacro(<<
"Set Joseph attenuated forward projection filter but no attenuation map is given");
298 if (this->GetSuperiorClipImage().IsNotNull())
302 ->SetSuperiorClipImage(this->GetSuperiorClipImage());
304 if (this->GetInferiorClipImage().IsNotNull())
308 ->SetInferiorClipImage(this->GetInferiorClipImage());
313 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
314 ForwardProjectionPointerType
317 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
322 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
323 ForwardProjectionPointerType
328 if (this->GetAttenuationMap().IsNotNull())
330 fw->SetInput(2, this->GetAttenuationMap());
333 ->SetSigmaZero(m_SigmaZero);
335 ->SetAlpha(m_AlphaPSF);
339 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
340 BackProjectionPointerType
345 bp = CudaBackProjectionImageFilter<ImageType>::New();
351 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
352 BackProjectionPointerType
355 itkGenericExceptionMacro(
356 <<
"CudaBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
361 template <
typename ImageType, EnableCudaScalarType<ImageType> * =
nullptr>
362 BackProjectionPointerType
367 bp = CudaRayCastBackProjectionImageFilter::New();
368 dynamic_cast<rtk::CudaRayCastBackProjectionImageFilter *
>(bp.GetPointer())->SetStepSize(m_StepSize);
374 template <
typename ImageType, DisableCudaScalarType<ImageType> * =
nullptr>
375 BackProjectionPointerType
378 itkGenericExceptionMacro(<<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float.");
383 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
384 BackProjectionPointerType
387 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
392 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
393 BackProjectionPointerType
398 if (this->GetAttenuationMap().IsNotNull())
400 bp->SetInput(2, this->GetAttenuationMap());
405 itkExceptionMacro(<<
"Set Joseph attenuated backprojection filter but no attenuation map is given");
410 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
411 BackProjectionPointerType
414 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
419 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
420 BackProjectionPointerType
425 if (this->GetAttenuationMap().IsNotNull())
427 bp->SetInput(2, this->GetAttenuationMap());
430 ->SetSigmaZero(m_SigmaZero);
432 ->SetAlpha(m_AlphaPSF);
440 #ifndef ITK_MANUAL_INSTANTIATION 441 # 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
void SetSuperiorClipImage(const TClipImageType *superiorClipImage)
typename std::enable_if< itk::PixelTraits< typename ImageType::PixelType >::Dimension==1 >::type DisableVectorType
ForwardProjectionType m_CurrentForwardProjectionConfiguration
BackProjectionPointerType InstantiateCudaBackProjection()
typename std::enable_if< !std::is_same< CPUImageType, ImageType >::value &&std::is_same< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >::value &&(itk::PixelTraits< typename ImageType::PixelType >::Dimension==1||itk::PixelTraits< typename ImageType::PixelType >::Dimension==2||itk::PixelTraits< typename ImageType::PixelType >::Dimension==3)>::type EnableCudaScalarAndVectorType
typename std::enable_if< !std::is_same< CPUImageType, ImageType >::value &&std::is_same< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >::value &&itk::PixelTraits< typename ImageType::PixelType >::Dimension==1 >::type EnableCudaScalarType
Joseph forward projection.
TClipImageType::ConstPointer GetInferiorClipImage()
#define itkSetMacro(name, type)
BackProjectionPointerType InstantiateCudaRayCastBackProjection()
ForwardProjectionType GetForwardProjectionFilter()
DataObject * GetInput(const DataObjectIdentifierType &key)
void SetInferiorClipImage(const TClipImageType *inferiorClipImage)
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
BackProjectionType m_CurrentBackProjectionConfiguration
ForwardProjectionPointerType InstantiateCudaForwardProjection()
typename std::enable_if< std::is_same< CPUImageType, ImageType >::value||!std::is_same< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >::value||(itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 &&itk::PixelTraits< typename ImageType::PixelType >::Dimension !=2 &&itk::PixelTraits< typename ImageType::PixelType >::Dimension !=3)>::type DisableCudaScalarAndVectorType
BackProjectionPointerType InstantiateZengBackProjection()
BackProjectionPointerType InstantiateJosephBackAttenuatedProjection()
typename std::enable_if< itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 >::type EnableVectorType
typename std::enable_if< std::is_same< CPUImageType, ImageType >::value||!std::is_same< typename itk::PixelTraits< typename ImageType::PixelType >::ValueType, float >::value||itk::PixelTraits< typename ImageType::PixelType >::Dimension !=1 >::type DisableCudaScalarType
ForwardProjectionPointerType InstantiateZengForwardProjection()
BackProjectionType GetBackProjectionFilter()