From 3cf63d335ebe392a8c77f0c90395c18150647aeb Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 29 Mar 2019 21:21:29 +0100 Subject: Adjust adjoint to line integral scaling --- src/CudaReconstructionAlgorithm2D.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 1e81390..939a026 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -309,8 +309,7 @@ void CCudaReconstructionAlgorithm2D::run(int _iNrIterations) m_bAlgoInit = true; } - float fPixelSize = volgeom.getPixelLengthX(); - float fSinogramScale = 1.0f/(fPixelSize*fPixelSize); + float fSinogramScale = 1.0f; ok = m_pAlgo->copyDataToGPU(m_pSinogram->getDataConst(), m_pSinogram->getGeometry()->getDetectorCount(), fSinogramScale, m_pReconstruction->getDataConst(), volgeom.getGridColCount(), -- cgit v1.2.3 From 48f4e7b165404a0375db300b9fe59da92edf1cce Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 30 Mar 2019 20:49:42 +0100 Subject: Adjust FBP to line integral scaling --- cuda/2d/algo.cu | 13 +++++++------ cuda/2d/cgls.cu | 4 ++-- cuda/2d/fbp.cu | 5 ++--- include/astra/cuda/2d/algo.h | 7 +++++-- include/astra/cuda/2d/cgls.h | 2 +- src/CudaFilteredBackProjectionAlgorithm.cpp | 7 +++++++ src/CudaReconstructionAlgorithm2D.cpp | 4 +--- src/FilteredBackProjectionAlgorithm.cpp | 8 ++++++-- 8 files changed, 31 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/cuda/2d/algo.cu b/cuda/2d/algo.cu index 11422ff..59ea984 100644 --- a/cuda/2d/algo.cu +++ b/cuda/2d/algo.cu @@ -153,6 +153,12 @@ bool ReconAlgo::setSuperSampling(int raysPerDet, int raysPerPixelDim) return true; } +bool ReconAlgo::setReconstructionScale(float fScale) +{ + fOutputScale *= fScale; + return true; +} + bool ReconAlgo::setVolumeMask(float* _D_maskData, unsigned int _maskPitch) { assert(useVolumeMask); @@ -242,7 +248,7 @@ bool ReconAlgo::allocateBuffers() return true; } -bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, +bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, const float* pfReconstruction, unsigned int iReconstructionPitch, const float* pfVolMask, unsigned int iVolMaskPitch, const float* pfSinoMask, unsigned int iSinoMaskPitch) @@ -258,11 +264,6 @@ bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPit if (!ok) return false; - // rescale sinogram - if (fSinogramScale != 1.0f) - processSino(D_sinoData, fSinogramScale, - sinoPitch, dims); - ok = copyVolumeToDevice(pfReconstruction, iReconstructionPitch, dims, D_volumeData, volumePitch); diff --git a/cuda/2d/cgls.cu b/cuda/2d/cgls.cu index b6a9fae..905b960 100644 --- a/cuda/2d/cgls.cu +++ b/cuda/2d/cgls.cu @@ -102,14 +102,14 @@ bool CGLS::setBuffers(float* _D_volumeData, unsigned int _volumePitch, return true; } -bool CGLS::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, +bool CGLS::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, const float* pfReconstruction, unsigned int iReconstructionPitch, const float* pfVolMask, unsigned int iVolMaskPitch, const float* pfSinoMask, unsigned int iSinoMaskPitch) { sliceInitialized = false; - return ReconAlgo::copyDataToGPU(pfSinogram, iSinogramPitch, fSinogramScale, pfReconstruction, iReconstructionPitch, pfVolMask, iVolMaskPitch, pfSinoMask, iSinoMaskPitch); + return ReconAlgo::copyDataToGPU(pfSinogram, iSinogramPitch, pfReconstruction, iReconstructionPitch, pfVolMask, iVolMaskPitch, pfSinoMask, iSinoMaskPitch); } bool CGLS::iterate(unsigned int iterations) diff --git a/cuda/2d/fbp.cu b/cuda/2d/fbp.cu index a5b8a7a..65f1d68 100644 --- a/cuda/2d/fbp.cu +++ b/cuda/2d/fbp.cu @@ -321,15 +321,14 @@ bool FBP::iterate(unsigned int iterations) if (fanProjs) { float fOutputScale = 1.0 / (/*fPixelSize * fPixelSize * fPixelSize * */ fFanDetSize * fFanDetSize); - ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fOutputScale); + ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fOutputScale * this->fOutputScale); } else { // scale by number of angles. For the fan-beam case, this is already // handled by FDK_PreWeight float fOutputScale = (M_PI / 2.0f) / (float)dims.iProjAngles; - //fOutputScale /= fDetSize * fDetSize; - ok = BP(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, parProjs, fOutputScale); + ok = BP(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, parProjs, fOutputScale * this->fOutputScale); } if(!ok) { diff --git a/include/astra/cuda/2d/algo.h b/include/astra/cuda/2d/algo.h index 3fccdef..b6ec231 100644 --- a/include/astra/cuda/2d/algo.h +++ b/include/astra/cuda/2d/algo.h @@ -56,6 +56,10 @@ public: bool setSuperSampling(int raysPerDet, int raysPerPixelDim); + // Scale the final reconstruction. + // May be called at any time after setGeometry and before iterate(). Multiple calls stack. + bool setReconstructionScale(float fScale); + virtual bool enableVolumeMask(); virtual bool enableSinogramMask(); @@ -88,8 +92,7 @@ public: // sinogram, reconstruction, volume mask and sinogram mask in system RAM, // respectively. The corresponding pitch variables give the pitches // of these buffers, measured in floats. - // The sinogram is multiplied by fSinogramScale after uploading it. - virtual bool copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, + virtual bool copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, const float* pfReconstruction, unsigned int iReconstructionPitch, const float* pfVolMask, unsigned int iVolMaskPitch, const float* pfSinoMask, unsigned int iSinoMaskPitch); diff --git a/include/astra/cuda/2d/cgls.h b/include/astra/cuda/2d/cgls.h index 375a425..a854a74 100644 --- a/include/astra/cuda/2d/cgls.h +++ b/include/astra/cuda/2d/cgls.h @@ -47,7 +47,7 @@ public: virtual bool setBuffers(float* D_volumeData, unsigned int volumePitch, float* D_projData, unsigned int projPitch); - virtual bool copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, + virtual bool copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, const float* pfReconstruction, unsigned int iReconstructionPitch, const float* pfVolMask, unsigned int iVolMaskPitch, const float* pfSinoMask, unsigned int iSinoMaskPitch); diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 88e235b..69140fc 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -151,6 +151,13 @@ void CCudaFilteredBackProjectionAlgorithm::initCUDAAlgorithm() if (!ok) { ASTRA_ERROR("CCudaFilteredBackProjectionAlgorithm: Failed to set short-scan mode"); } + + const CVolumeGeometry2D& volGeom = *m_pProjector->getVolumeGeometry(); + float fPixelArea = volGeom.getPixelArea(); + ok &= pFBP->setReconstructionScale(1.0f/fPixelArea); + if (!ok) { + ASTRA_ERROR("CCudaFilteredBackProjectionAlgorithm: Failed to set reconstruction scale"); + } } diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 939a026..6730cea 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -309,9 +309,7 @@ void CCudaReconstructionAlgorithm2D::run(int _iNrIterations) m_bAlgoInit = true; } - float fSinogramScale = 1.0f; - - ok = m_pAlgo->copyDataToGPU(m_pSinogram->getDataConst(), m_pSinogram->getGeometry()->getDetectorCount(), fSinogramScale, + ok = m_pAlgo->copyDataToGPU(m_pSinogram->getDataConst(), m_pSinogram->getGeometry()->getDetectorCount(), m_pReconstruction->getDataConst(), volgeom.getGridColCount(), m_bUseReconstructionMask ? m_pReconstructionMask->getDataConst() : 0, volgeom.getGridColCount(), m_bUseSinogramMask ? m_pSinogramMask->getDataConst() : 0, m_pSinogram->getGeometry()->getDetectorCount()); diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp index 423dc6c..95bef3c 100644 --- a/src/FilteredBackProjectionAlgorithm.cpp +++ b/src/FilteredBackProjectionAlgorithm.cpp @@ -264,8 +264,12 @@ void CFilteredBackProjectionAlgorithm::run(int _iNrIterations) DefaultBPPolicy(m_pReconstruction, &filteredSinogram)); // Scale data - int iAngleCount = m_pProjector->getProjectionGeometry()->getProjectionAngleCount(); - (*m_pReconstruction) *= (PI/2)/iAngleCount; + const CVolumeGeometry2D& volGeom = *m_pProjector->getVolumeGeometry(); + const CProjectionGeometry2D& projGeom = *m_pProjector->getProjectionGeometry(); + + int iAngleCount = projGeom.getProjectionAngleCount(); + float fPixelArea = volGeom.getPixelArea(); + (*m_pReconstruction) *= PI/(2*iAngleCount*fPixelArea); m_pReconstruction->updateStatistics(); } -- cgit v1.2.3 From 4fba091ff811ac5e6035cf95efdaae6681e6cc46 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 1 Apr 2019 00:09:28 +0200 Subject: Add error check for non-parallel FBP --- src/FilteredBackProjectionAlgorithm.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp index 95bef3c..6b4093d 100644 --- a/src/FilteredBackProjectionAlgorithm.cpp +++ b/src/FilteredBackProjectionAlgorithm.cpp @@ -167,6 +167,11 @@ bool CFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) m_filterConfig = getFilterConfigForAlgorithm(_cfg, this); + const CParallelProjectionGeometry2D* parprojgeom = dynamic_cast(m_pSinogram->getGeometry()); + if (!parprojgeom) { + ASTRA_ERROR("FBP currently only supports parallel projection geometries."); + return false; + } // TODO: check that the angles are linearly spaced between 0 and pi -- cgit v1.2.3 From 975537c8c68b115399af522cb1a0a1e731eca576 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 2 Apr 2019 15:56:57 +0200 Subject: Fix fan-beam FBP scaling --- cuda/2d/fan_bp.cu | 11 +++++++---- cuda/2d/fbp.cu | 6 ++---- src/GeometryUtil2D.cpp | 9 ++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/cuda/2d/fan_bp.cu b/cuda/2d/fan_bp.cu index 0d21897..428485c 100644 --- a/cuda/2d/fan_bp.cu +++ b/cuda/2d/fan_bp.cu @@ -271,11 +271,14 @@ __global__ void devFanBP_FBPWeighted(float* D_volData, unsigned int volPitch, un const float fNum = fDetSY * fXD - fDetSX * fYD + fX*fSrcY - fY*fSrcX; const float fDen = fDetUX * fYD - fDetUY * fXD; + const float fr = __fdividef(1.0f, fDen); + + // fDen = || u (x-s) || + // Required scale factor is ( || u s || / || u (x-s) || ) ^ 2. + // The factor || u s || ^ 2 is handled by the preweighting - const float fWeight = fXD*fXD + fYD*fYD; - - const float fT = fNum / fDen; - fVal += tex2D(gT_FanProjTexture, fT, fA) / fWeight; + const float fT = fNum * fr; + fVal += tex2D(gT_FanProjTexture, fT, fA) * fr * fr; fA += 1.0f; } diff --git a/cuda/2d/fbp.cu b/cuda/2d/fbp.cu index f0edc19..28cdd92 100644 --- a/cuda/2d/fbp.cu +++ b/cuda/2d/fbp.cu @@ -301,7 +301,7 @@ bool FBP::iterate(unsigned int iterations) astraCUDA3d::FDK_PreWeight(tmp, fOriginSource, fOriginDetector, 0.0f, - fFanDetSize, 1.0f, /* fPixelSize */ 1.0f, + fFanDetSize, 1.0f, /* fPixelSize, but is normalized */ 1.0f, m_bShortScan, dims3d, pfAngles); } else { // TODO: How should different detector pixel size in different @@ -328,9 +328,7 @@ bool FBP::iterate(unsigned int iterations) } if (fanProjs) { - float fOutputScale = 1.0 / (/*fPixelSize * fPixelSize * fPixelSize * */ fFanDetSize * fFanDetSize); - - ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fOutputScale * fProjectorScale * fReconstructionScale); + ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fProjectorScale * fReconstructionScale); } else { // scale by number of angles. For the fan-beam case, this is already diff --git a/src/GeometryUtil2D.cpp b/src/GeometryUtil2D.cpp index e09a3bc..806572f 100644 --- a/src/GeometryUtil2D.cpp +++ b/src/GeometryUtil2D.cpp @@ -28,6 +28,7 @@ along with the ASTRA Toolbox. If not, see . #include "astra/GeometryUtil2D.h" #include +#include namespace astra { @@ -158,14 +159,16 @@ bool getFanParameters(const SFanProjection &proj, unsigned int iProjDets, float // project origin on detector line ( == project source on detector line) double t = (- proj.fDetSX) * proj.fDetUX + (- proj.fDetSY) * proj.fDetUY; + t /= (proj.fDetUX * proj.fDetUX + proj.fDetUY * proj.fDetUY); fOffset = (float)t - 0.5*iProjDets; - // TODO: CHECKME fOriginDetector = sqrt((proj.fDetSX + t * proj.fDetUX)*(proj.fDetSX + t * proj.fDetUX) + (proj.fDetSY + t * proj.fDetUY)*(proj.fDetSY + t * proj.fDetUY)); - //float fAngle = atan2(proj.fDetSX + t * proj.fDetUX - proj.fSrcX, proj.fDetSY + t * proj.fDetUY); // TODO: Fix order + sign - fAngle = atan2(proj.fDetUY, proj.fDetUX); // TODO: Check order + sign + fAngle = atan2(proj.fDetUY, proj.fDetUX); + + //fprintf(stderr, "getFanParams: s = (%f,%f) d = (%f,%f) u = (%f,%f)\n", proj.fSrcX, proj.fSrcY, proj.fDetSX, proj.fDetSY, proj.fDetUX, proj.fDetUY); + //fprintf(stderr, "getFanParams: fOS = %f, fOD = %f, detsize = %f, offset = %f (t = %f), angle = %f\n", fOriginSource, fOriginDetector, fDetSize, fOffset, t, fAngle); return true; } -- cgit v1.2.3 From 4b576ee6ad461b162dd64538f54df47b65b37972 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 3 Apr 2019 22:31:55 +0200 Subject: Remove obsolete DensityWeighting option --- cuda/3d/mem3d.cu | 4 ++-- include/astra/CudaProjector3D.h | 2 -- src/CompositeGeometryManager.cpp | 4 +--- src/CudaProjector3D.cpp | 8 -------- 4 files changed, 3 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index 697d2d2..50cfe75 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -268,7 +268,7 @@ bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con return ok; } -bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling, bool bFDKWeighting) +bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling) { assert(!volData.d->arr); SDimensions3D dims; @@ -289,7 +289,7 @@ bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con pParProjs, pConeProjs, params); - params.bFDKWeighting = bFDKWeighting; + params.bFDKWeighting = false; if (pParProjs) { if (projData.d->arr) diff --git a/include/astra/CudaProjector3D.h b/include/astra/CudaProjector3D.h index 60df7bb..9b4ff1f 100644 --- a/include/astra/CudaProjector3D.h +++ b/include/astra/CudaProjector3D.h @@ -117,7 +117,6 @@ public: int getVoxelSuperSampling() const { return m_iVoxelSuperSampling; } int getDetectorSuperSampling() const { return m_iDetectorSuperSampling; } int getGPUIndex() const { return m_iGPUIndex; } - bool getDensityWeighting() const { return m_bDensityWeighting; } protected: @@ -125,7 +124,6 @@ protected: int m_iVoxelSuperSampling; int m_iDetectorSuperSampling; int m_iGPUIndex; - bool m_bDensityWeighting; }; diff --git a/src/CompositeGeometryManager.cpp b/src/CompositeGeometryManager.cpp index 1319a87..822f746 100644 --- a/src/CompositeGeometryManager.cpp +++ b/src/CompositeGeometryManager.cpp @@ -1462,12 +1462,10 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter Cuda3DProjectionKernel projKernel = ker3d_default; int detectorSuperSampling = 1; int voxelSuperSampling = 1; - bool densityWeighting = false; if (projector) { projKernel = projector->getProjectionKernel(); detectorSuperSampling = projector->getDetectorSuperSampling(); voxelSuperSampling = projector->getVoxelSuperSampling(); - densityWeighting = projector->getDensityWeighting(); } size_t inx, iny, inz; @@ -1513,7 +1511,7 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter ASTRA_DEBUG("CCompositeGeometryManager::doJobs: doing BP"); - ok = astraCUDA3d::BP(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, srcMem->hnd, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, dstMem->hnd, voxelSuperSampling, densityWeighting); + ok = astraCUDA3d::BP(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, srcMem->hnd, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, dstMem->hnd, voxelSuperSampling); if (!ok) ASTRA_ERROR("Error performing sub-BP"); ASTRA_DEBUG("CCompositeGeometryManager::doJobs: BP done"); } diff --git a/src/CudaProjector3D.cpp b/src/CudaProjector3D.cpp index 3ea7043..e5c55cc 100644 --- a/src/CudaProjector3D.cpp +++ b/src/CudaProjector3D.cpp @@ -67,7 +67,6 @@ void CCudaProjector3D::_clear() m_iVoxelSuperSampling = 1; m_iDetectorSuperSampling = 1; m_iGPUIndex = -1; - m_bDensityWeighting = false; } //---------------------------------------------------------------------------------------- @@ -132,13 +131,6 @@ bool CCudaProjector3D::initialize(const Config& _cfg) m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); CC.markOptionParsed("DetectorSuperSampling"); - if (dynamic_cast(m_pProjectionGeometry) || - dynamic_cast(m_pProjectionGeometry)) - { - m_bDensityWeighting = _cfg.self.getOptionBool("DensityWeighting", false); - CC.markOptionParsed("DensityWeighting"); - } - m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1); m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex); CC.markOptionParsed("GPUIndex"); -- cgit v1.2.3 From 744605ed826196aa6e0e3e3b5e945e50d830ed3a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 3 Apr 2019 22:32:11 +0200 Subject: Add feature flags for changed scaling behaviour --- include/astra/Features.h | 16 ++++++++++++++-- src/Features.cpp | 6 ++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/include/astra/Features.h b/include/astra/Features.h index d88ae71..c7ef98c 100644 --- a/include/astra/Features.h +++ b/include/astra/Features.h @@ -38,10 +38,22 @@ _AstraExport bool hasFeature(const std::string &feature); FEATURES: -cuda: is cuda support compiled in? +cuda + is cuda support compiled in? NB: To check if there is also actually a usable GPU, use cudaAvailable() -mex_link: is there support for the matlab command astra_mex_data3d('link')? +mex_link + is there support for the matlab command astra_mex_data3d('link')? + +projectors_scaled_as_line_integrals + This is set since all 2D and 3D, CPU and GPU projectors scale their outputs + to approximate line integrals. (Previously, some 2D projectors were scaled + as area integrals.) + +fan_cone_BP_density_weighting_by_default + This is set since fan beam and cone beam BP operations perform ray density + weighting by default to more closely approximate the true mathematical adjoint. + The DensityWeighting cuda3d projector option is removed. For future backward-incompatible changes, extra features will be added here diff --git a/src/Features.cpp b/src/Features.cpp index 9114131..09a3499 100644 --- a/src/Features.cpp +++ b/src/Features.cpp @@ -34,6 +34,12 @@ _AstraExport bool hasFeature(const std::string &flag) { if (flag == "cuda") { return cudaEnabled(); } + if (flag == "projectors_scaled_as_line_integrals") { + return true; + } + if (flag == "fan_cone_BP_density_weighting_by_default") { + return true; + } return false; } -- cgit v1.2.3 From 9d7e93d57183d5a1e1efd113067bdcc8d388bc50 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 11 Apr 2019 16:52:19 +0200 Subject: Fix crash in FBP_CUDA when called without projector --- src/CudaFilteredBackProjectionAlgorithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 69140fc..c1d3dc8 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -152,7 +152,7 @@ void CCudaFilteredBackProjectionAlgorithm::initCUDAAlgorithm() ASTRA_ERROR("CCudaFilteredBackProjectionAlgorithm: Failed to set short-scan mode"); } - const CVolumeGeometry2D& volGeom = *m_pProjector->getVolumeGeometry(); + const CVolumeGeometry2D& volGeom = *m_pReconstruction->getGeometry(); float fPixelArea = volGeom.getPixelArea(); ok &= pFBP->setReconstructionScale(1.0f/fPixelArea); if (!ok) { -- cgit v1.2.3