From 609e81d67217f4ff21c8a0aec82584da0fee1908 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 6 Apr 2019 18:01:16 +0200 Subject: Remove unmaintained, out of date 'STANDALONE' cuda code --- cuda/2d/fan_fp.cu | 85 ------------------------------------------------------- 1 file changed, 85 deletions(-) (limited to 'cuda/2d/fan_fp.cu') diff --git a/cuda/2d/fan_fp.cu b/cuda/2d/fan_fp.cu index 3479650..60c02f8 100644 --- a/cuda/2d/fan_fp.cu +++ b/cuda/2d/fan_fp.cu @@ -28,10 +28,6 @@ along with the ASTRA Toolbox. If not, see . #include "astra/cuda/2d/util.h" #include "astra/cuda/2d/arith.h" -#ifdef STANDALONE -#include "testutil.h" -#endif - #include #include #include @@ -308,84 +304,3 @@ bool FanFP(float* D_volumeData, unsigned int volumePitch, } } - -#ifdef STANDALONE - -using namespace astraCUDA; - -int main() -{ - float* D_volumeData; - float* D_projData; - - SDimensions dims; - dims.iVolWidth = 128; - dims.iVolHeight = 128; - dims.iProjAngles = 180; - dims.iProjDets = 256; - dims.fDetScale = 1.0f; - dims.iRaysPerDet = 1; - unsigned int volumePitch, projPitch; - - SFanProjection projs[180]; - - projs[0].fSrcX = 0.0f; - projs[0].fSrcY = 1536.0f; - projs[0].fDetSX = 128.0f; - projs[0].fDetSY = -512.0f; - projs[0].fDetUX = -1.0f; - projs[0].fDetUY = 0.0f; - -#define ROTATE0(name,i,alpha) do { projs[i].f##name##X = projs[0].f##name##X * cos(alpha) - projs[0].f##name##Y * sin(alpha); projs[i].f##name##Y = projs[0].f##name##X * sin(alpha) + projs[0].f##name##Y * cos(alpha); } while(0) - - for (int i = 1; i < 180; ++i) { - ROTATE0(Src, i, i*2*M_PI/180); - ROTATE0(DetS, i, i*2*M_PI/180); - ROTATE0(DetU, i, i*2*M_PI/180); - } - -#undef ROTATE0 - - allocateVolume(D_volumeData, dims.iVolWidth, dims.iVolHeight, volumePitch); - printf("pitch: %u\n", volumePitch); - - allocateVolume(D_projData, dims.iProjDets, dims.iProjAngles, projPitch); - printf("pitch: %u\n", projPitch); - - unsigned int y, x; - float* img = loadImage("phantom128.png", y, x); - - float* sino = new float[dims.iProjAngles * dims.iProjDets]; - - memset(sino, 0, dims.iProjAngles * dims.iProjDets * sizeof(float)); - - copyVolumeToDevice(img, dims.iVolWidth, dims.iVolWidth, dims.iVolHeight, D_volumeData, volumePitch); - copySinogramToDevice(sino, dims.iProjDets, dims.iProjDets, dims.iProjAngles, D_projData, projPitch); - - float* angle = new float[dims.iProjAngles]; - - for (unsigned int i = 0; i < dims.iProjAngles; ++i) - angle[i] = i*(M_PI/dims.iProjAngles); - - FanFP(D_volumeData, volumePitch, D_projData, projPitch, dims, projs, 1.0f); - - delete[] angle; - - copySinogramFromDevice(sino, dims.iProjDets, dims.iProjDets, dims.iProjAngles, D_projData, projPitch); - - float s = 0.0f; - for (unsigned int y = 0; y < dims.iProjAngles; ++y) - for (unsigned int x = 0; x < dims.iProjDets; ++x) - s += sino[y*dims.iProjDets+x] * sino[y*dims.iProjDets+x]; - printf("cpu norm: %f\n", s); - - //zeroVolume(D_projData, projPitch, dims.iProjDets, dims.iProjAngles); - s = dotProduct2D(D_projData, projPitch, dims.iProjDets, dims.iProjAngles); - printf("gpu norm: %f\n", s); - - saveImage("sino.png",dims.iProjAngles,dims.iProjDets,sino); - - - return 0; -} -#endif -- cgit v1.2.3