diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-01-09 14:09:40 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-01-09 14:09:40 +0100 |
commit | de27e439a0c59fade175fba4e0b4a1e0c84b933d (patch) | |
tree | 8d724e10b35291f5bfd63174eeeca95e52a863df /src/CudaReconstructionAlgorithm2D.cpp | |
parent | 324611ce98a82944def875e61cb93dd98ced9c79 (diff) | |
parent | 84da1d5e27abadf28e97695e88494c58bf1c2697 (diff) | |
download | astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.gz astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.bz2 astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.xz astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.zip |
Merge branch 'parallel_vec'
Diffstat (limited to 'src/CudaReconstructionAlgorithm2D.cpp')
-rw-r--r-- | src/CudaReconstructionAlgorithm2D.cpp | 63 |
1 files changed, 4 insertions, 59 deletions
diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 96f52f0..f37647c 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -249,69 +249,14 @@ bool CCudaReconstructionAlgorithm2D::setupGeometry() ok = m_pAlgo->setGPUIndex(m_iGPUIndex); if (!ok) return false; - astraCUDA::SDimensions dims; - const CVolumeGeometry2D& volgeom = *m_pReconstruction->getGeometry(); + const CProjectionGeometry2D& projgeom = *m_pSinogram->getGeometry(); - // TODO: non-square pixels? - dims.iVolWidth = volgeom.getGridColCount(); - dims.iVolHeight = volgeom.getGridRowCount(); - float fPixelSize = volgeom.getPixelLengthX(); - - dims.iRaysPerDet = m_iDetectorSuperSampling; - dims.iRaysPerPixelDim = m_iPixelSuperSampling; - - - const CParallelProjectionGeometry2D* parProjGeom = dynamic_cast<CParallelProjectionGeometry2D*>(m_pSinogram->getGeometry()); - const CFanFlatProjectionGeometry2D* fanProjGeom = dynamic_cast<CFanFlatProjectionGeometry2D*>(m_pSinogram->getGeometry()); - const CFanFlatVecProjectionGeometry2D* fanVecProjGeom = dynamic_cast<CFanFlatVecProjectionGeometry2D*>(m_pSinogram->getGeometry()); - - if (parProjGeom) { - - float *offsets, *angles, detSize, outputScale; - - ok = convertAstraGeometry(&volgeom, parProjGeom, offsets, angles, detSize, outputScale); - - dims.iProjAngles = parProjGeom->getProjectionAngleCount(); - dims.iProjDets = parProjGeom->getDetectorCount(); - dims.fDetScale = parProjGeom->getDetectorWidth() / fPixelSize; - - ok = m_pAlgo->setGeometry(dims, parProjGeom->getProjectionAngles()); - ok &= m_pAlgo->setTOffsets(offsets); - - // CHECKME: outputScale? detSize? - - delete[] offsets; - delete[] angles; - - } else if (fanProjGeom || fanVecProjGeom) { - - astraCUDA::SFanProjection* projs; - float outputScale; - - if (fanProjGeom) { - ok = convertAstraGeometry(&volgeom, fanProjGeom, projs, outputScale); - } else { - ok = convertAstraGeometry(&volgeom, fanVecProjGeom, projs, outputScale); - } - - dims.iProjAngles = m_pSinogram->getGeometry()->getProjectionAngleCount(); - dims.iProjDets = m_pSinogram->getGeometry()->getDetectorCount(); - dims.fDetScale = m_pSinogram->getGeometry()->getDetectorWidth() / fPixelSize; - - ok = m_pAlgo->setFanGeometry(dims, projs); - - // CHECKME: outputScale? - - delete[] projs; - - } else { - - ASTRA_ASSERT(false); - - } + ok = m_pAlgo->setGeometry(&volgeom, &projgeom); if (!ok) return false; + ok = m_pAlgo->setSuperSampling(m_iDetectorSuperSampling, m_iPixelSuperSampling); + if (!ok) return false; if (m_bUseReconstructionMask) ok &= m_pAlgo->enableVolumeMask(); |