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,
107 return m_CurrentForwardProjectionConfiguration;
110 SetBackProjectionFilter(BackProjectionType bptype);
114 return m_CurrentBackProjectionConfiguration;
124 this->SetNthInput(2, const_cast<VolumeType *>(attenuationMap));
126 typename VolumeType::ConstPointer
140 this->SetInput(
"InferiorClipImage", const_cast<TClipImageType *>(inferiorClipImage));
142 typename TClipImageType::ConstPointer
156 this->SetInput(
"SuperiorClipImage", const_cast<TClipImageType *>(superiorClipImage));
158 typename TClipImageType::ConstPointer
166 itkGetMacro(SigmaZero,
double);
171 itkGetMacro(AlphaPSF,
double);
176 itkGetConstMacro(StepSize,
double);
186 virtual BackProjectionPointerType
187 InstantiateBackProjectionFilter(
int bptype);
191 virtual ForwardProjectionPointerType
192 InstantiateForwardProjectionFilter(
int fwtype);
201 std::default_random_engine m_DefaultRandomEngine = std::default_random_engine{};
204 double m_SigmaZero{ 1.5417233052142099 };
205 double m_AlphaPSF{ 0.016241189545787734 };
208 double m_StepSize{ 1.0 };
213 template <
typename ImageType>
215 !std::is_same<CPUImageType, ImageType>::value &&
216 std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value &&
220 template <
typename ImageType>
222 std::is_same<CPUImageType, ImageType>::value ||
223 !std::is_same<typename itk::PixelTraits<typename ImageType::PixelType>::ValueType,
float>::value ||
227 template <
typename ImageType>
229 !std::is_same<CPUImageType, ImageType>::value &&
230 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 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension != 1>::type;
240 template <
typename ImageType>
242 typename std::enable_if<itk::PixelTraits<typename ImageType::PixelType>::Dimension == 1>::type;
245 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
251 fw = CudaForwardProjectionImageFilter<ImageType, ImageType>::New();
252 dynamic_cast<rtk::CudaForwardProjectionImageFilter<ImageType, ImageType> *
>(fw.GetPointer())
253 ->SetStepSize(m_StepSize);
259 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
260 ForwardProjectionPointerType
263 itkGenericExceptionMacro(
264 <<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
269 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
270 ForwardProjectionPointerType
273 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
278 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
279 ForwardProjectionPointerType
284 if (this->GetAttenuationMap().IsNotNull())
286 fw->SetInput(2, this->GetAttenuationMap());
290 itkExceptionMacro(<<
"Set Joseph attenuated forward projection filter but no attenuation map is given");
293 if (this->GetSuperiorClipImage().IsNotNull())
297 ->SetSuperiorClipImage(this->GetSuperiorClipImage());
299 if (this->GetInferiorClipImage().IsNotNull())
303 ->SetInferiorClipImage(this->GetInferiorClipImage());
308 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
309 ForwardProjectionPointerType
312 itkGenericExceptionMacro(<<
"JosephForwardAttenuatedProjectionImageFilter only available with scalar pixel types.");
317 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
318 ForwardProjectionPointerType
323 if (this->GetAttenuationMap().IsNotNull())
325 fw->SetInput(2, this->GetAttenuationMap());
328 ->SetSigmaZero(m_SigmaZero);
330 ->SetAlpha(m_AlphaPSF);
334 template <
typename ImageType, EnableCudaScalarAndVectorType<ImageType> * =
nullptr>
335 BackProjectionPointerType
340 bp = CudaBackProjectionImageFilter<ImageType>::New();
346 template <
typename ImageType, DisableCudaScalarAndVectorType<ImageType> * =
nullptr>
347 BackProjectionPointerType
350 itkGenericExceptionMacro(
351 <<
"CudaBackProjectionImageFilter only available with 3D CudaImage of float or itk::Vector<float,3>.");
356 template <
typename ImageType, EnableCudaScalarType<ImageType> * =
nullptr>
357 BackProjectionPointerType
362 bp = CudaRayCastBackProjectionImageFilter::New();
363 dynamic_cast<rtk::CudaRayCastBackProjectionImageFilter *
>(bp.GetPointer())->SetStepSize(m_StepSize);
369 template <
typename ImageType, DisableCudaScalarType<ImageType> * =
nullptr>
370 BackProjectionPointerType
373 itkGenericExceptionMacro(<<
"CudaRayCastBackProjectionImageFilter only available with 3D CudaImage of float.");
378 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
379 BackProjectionPointerType
382 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
387 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
388 BackProjectionPointerType
393 if (this->GetAttenuationMap().IsNotNull())
395 bp->SetInput(2, this->GetAttenuationMap());
400 itkExceptionMacro(<<
"Set Joseph attenuated backprojection filter but no attenuation map is given");
405 template <
typename ImageType, EnableVectorType<ImageType> * =
nullptr>
406 BackProjectionPointerType
409 itkGenericExceptionMacro(<<
"JosephBackAttenuatedProjectionImageFilter only available with scalar pixel types.");
414 template <
typename ImageType, DisableVectorType<ImageType> * =
nullptr>
415 BackProjectionPointerType
420 if (this->GetAttenuationMap().IsNotNull())
422 bp->SetInput(2, this->GetAttenuationMap());
425 ->SetSigmaZero(m_SigmaZero);
427 ->SetAlpha(m_AlphaPSF);
435 #ifndef ITK_MANUAL_INSTANTIATION 436 # 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()
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()
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()