From 399422985fd27a1e6a1f8cea3642402128b050fa Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 20 May 2016 15:10:03 +0200 Subject: Add option to specify custom filter for FDK --- cuda/3d/astra3d.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cuda/3d/astra3d.cu') diff --git a/cuda/3d/astra3d.cu b/cuda/3d/astra3d.cu index 5670873..35e3cd4 100644 --- a/cuda/3d/astra3d.cu +++ b/cuda/3d/astra3d.cu @@ -1311,7 +1311,7 @@ bool astraCudaFDK(float* pfVolume, const float* pfProjections, const CVolumeGeometry3D* pVolGeom, const CConeProjectionGeometry3D* pProjGeom, bool bShortScan, - int iGPUIndex, int iVoxelSuperSampling) + int iGPUIndex, int iVoxelSuperSampling, const float* filter) { SDimensions3D dims; @@ -1369,7 +1369,7 @@ bool astraCudaFDK(float* pfVolume, const float* pfProjections, // TODO: Offer interface for SrcZ, DetZ ok &= FDK(D_volumeData, D_projData, fOriginSourceDistance, fOriginDetectorDistance, 0, 0, fDetUSize, fDetVSize, - dims, pfAngles, bShortScan); + dims, pfAngles, bShortScan, filter); ok &= copyVolumeFromDevice(pfVolume, D_volumeData, dims, dims.iVolX); -- cgit v1.2.3 From 71db6331f8dd0d5abbeee92977af01293be4f427 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 28 Nov 2016 15:54:07 +0100 Subject: Update headers (website+2016) --- cuda/3d/astra3d.cu | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cuda/3d/astra3d.cu') diff --git a/cuda/3d/astra3d.cu b/cuda/3d/astra3d.cu index 3bd56ea..8e0946e 100644 --- a/cuda/3d/astra3d.cu +++ b/cuda/3d/astra3d.cu @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see . ----------------------------------------------------------------------- -$Id$ */ #include -- cgit v1.2.3 From aa325035704f932e29217274aeab26ae46847a7b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 17 Feb 2017 15:56:36 +0100 Subject: Fix cuda3d geometry memory leaks --- cuda/3d/astra3d.cu | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'cuda/3d/astra3d.cu') diff --git a/cuda/3d/astra3d.cu b/cuda/3d/astra3d.cu index 8e0946e..30cbe1b 100644 --- a/cuda/3d/astra3d.cu +++ b/cuda/3d/astra3d.cu @@ -319,6 +319,9 @@ AstraSIRT3d::~AstraSIRT3d() delete[] pData->projs; pData->projs = 0; + delete[] pData->parprojs; + pData->parprojs = 0; + cudaFree(pData->D_projData.ptr); pData->D_projData.ptr = 0; @@ -702,6 +705,9 @@ AstraCGLS3d::~AstraCGLS3d() delete[] pData->projs; pData->projs = 0; + delete[] pData->parprojs; + pData->parprojs = 0; + cudaFree(pData->D_projData.ptr); pData->D_projData.ptr = 0; @@ -1133,19 +1139,27 @@ bool astraCudaBP(float* pfVolume, const float* pfProjections, cudaError_t err = cudaGetLastError(); // Ignore errors caused by calling cudaSetDevice multiple times - if (err != cudaSuccess && err != cudaErrorSetOnActiveProcess) + if (err != cudaSuccess && err != cudaErrorSetOnActiveProcess) { + delete[] pParProjs; + delete[] pConeProjs; return false; + } } cudaPitchedPtr D_volumeData = allocateVolumeData(dims); ok = D_volumeData.ptr; - if (!ok) + if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; return false; + } cudaPitchedPtr D_projData = allocateProjectionData(dims); ok = D_projData.ptr; if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_volumeData.ptr); return false; } @@ -1156,6 +1170,8 @@ bool astraCudaBP(float* pfVolume, const float* pfProjections, ok &= zeroVolumeData(D_volumeData, dims); if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_volumeData.ptr); cudaFree(D_projData.ptr); return false; @@ -1168,6 +1184,8 @@ bool astraCudaBP(float* pfVolume, const float* pfProjections, ok &= copyVolumeFromDevice(pfVolume, D_volumeData, dims, dims.iVolX); + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_volumeData.ptr); cudaFree(D_projData.ptr); @@ -1208,19 +1226,27 @@ bool astraCudaBP_SIRTWeighted(float* pfVolume, cudaError_t err = cudaGetLastError(); // Ignore errors caused by calling cudaSetDevice multiple times - if (err != cudaSuccess && err != cudaErrorSetOnActiveProcess) + if (err != cudaSuccess && err != cudaErrorSetOnActiveProcess) { + delete[] pParProjs; + delete[] pConeProjs; return false; + } } cudaPitchedPtr D_pixelWeight = allocateVolumeData(dims); ok = D_pixelWeight.ptr; - if (!ok) + if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; return false; + } cudaPitchedPtr D_volumeData = allocateVolumeData(dims); ok = D_volumeData.ptr; if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_pixelWeight.ptr); return false; } @@ -1228,6 +1254,8 @@ bool astraCudaBP_SIRTWeighted(float* pfVolume, cudaPitchedPtr D_projData = allocateProjectionData(dims); ok = D_projData.ptr; if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_pixelWeight.ptr); cudaFree(D_volumeData.ptr); return false; @@ -1244,6 +1272,8 @@ bool astraCudaBP_SIRTWeighted(float* pfVolume, processVol3D(D_pixelWeight, dims); if (!ok) { + delete[] pParProjs; + delete[] pConeProjs; cudaFree(D_pixelWeight.ptr); cudaFree(D_volumeData.ptr); cudaFree(D_projData.ptr); -- cgit v1.2.3