//--------------------------------------------------------------------------------------- void CCudaFDKAlgorithm3D::initializeFromProjector() { m_iVoxelSuperSampling = 1; m_iGPUIndex = -1; CCudaProjector3D* pCudaProjector = dynamic_cast<CCudaProjector3D*>(m_pProjector); if (!pCudaProjector) { if (m_pProjector) { ASTRA_WARN("non-CUDA Projector3D passed to FDK_CUDA"); } } else { m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling(); m_iGPUIndex = pCudaProjector->getGPUIndex(); } }
//--------------------------------------------------------------------------------------- // Initialize - Config bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg) { ASTRA_ASSERT(_cfg.self); ConfigStackCheck<CAlgorithm> CC("CudaBackProjectionAlgorithm3D", this, _cfg); // if already initialized, clear first if (m_bIsInitialized) { clear(); } // initialization of parent class if (!CReconstructionAlgorithm3D::initialize(_cfg)) { return false; } CCudaProjector3D* pCudaProjector = 0; pCudaProjector = dynamic_cast<CCudaProjector3D*>(m_pProjector); if (!pCudaProjector) { // TODO: Report } m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1); CC.markOptionParsed("GPUindex"); m_iVoxelSuperSampling = 1; if (pCudaProjector) m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling(); m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling); CC.markOptionParsed("VoxelSuperSampling"); CFloat32ProjectionData3DMemory* pSinoMem = dynamic_cast<CFloat32ProjectionData3DMemory*>(m_pSinogram); ASTRA_ASSERT(pSinoMem); const CProjectionGeometry3D* projgeom = pSinoMem->getGeometry(); const CParallelProjectionGeometry3D* par3dgeom = dynamic_cast<const CParallelProjectionGeometry3D*>(projgeom); const CParallelVecProjectionGeometry3D* parvec3dgeom = dynamic_cast<const CParallelVecProjectionGeometry3D*>(projgeom); if (parvec3dgeom || par3dgeom) { // This option is only supported for Par3D currently m_bSIRTWeighting = _cfg.self.getOptionBool("SIRTWeighting", false); CC.markOptionParsed("SIRTWeighting"); } // success m_bIsInitialized = _check(); return m_bIsInitialized; }