summaryrefslogtreecommitdiffstats
path: root/cuda
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-02 13:42:08 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-02 13:42:08 +0100
commitbf5aa06406162656752f031edf3ca90f00ff76dd (patch)
tree0c0544cb4e9f892523b2aed581c7a56510383595 /cuda
parent24a2b2b0a6a354efd58774a4bce930cb9f90334f (diff)
downloadastra-bf5aa06406162656752f031edf3ca90f00ff76dd.tar.gz
astra-bf5aa06406162656752f031edf3ca90f00ff76dd.tar.bz2
astra-bf5aa06406162656752f031edf3ca90f00ff76dd.tar.xz
astra-bf5aa06406162656752f031edf3ca90f00ff76dd.zip
Untangle cuda and astra includes
Diffstat (limited to 'cuda')
-rw-r--r--cuda/2d/dims.h12
-rw-r--r--cuda/3d/dims3d.cu74
-rw-r--r--cuda/3d/dims3d.h41
3 files changed, 4 insertions, 123 deletions
diff --git a/cuda/2d/dims.h b/cuda/2d/dims.h
index 37bfa66..e870da5 100644
--- a/cuda/2d/dims.h
+++ b/cuda/2d/dims.h
@@ -29,18 +29,12 @@ $Id$
#ifndef _CUDA_DIMS_H
#define _CUDA_DIMS_H
-namespace astraCUDA {
+#include "astra/GeometryUtil2D.h"
-struct SFanProjection {
- // the source
- float fSrcX, fSrcY;
- // the start of the (linear) detector
- float fDetSX, fDetSY;
+namespace astraCUDA {
- // the length of a single detector pixel
- float fDetUX, fDetUY;
-};
+using astra::SFanProjection;
struct SDimensions {
diff --git a/cuda/3d/dims3d.cu b/cuda/3d/dims3d.cu
deleted file mode 100644
index 83a8eba..0000000
--- a/cuda/3d/dims3d.cu
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
------------------------------------------------------------------------
-Copyright 2012 iMinds-Vision Lab, University of Antwerp
-
-Contact: astra@ua.ac.be
-Website: http://astra.ua.ac.be
-
-
-This file is part of the
-All Scale Tomographic Reconstruction Antwerp Toolbox ("ASTRA Toolbox").
-
-The ASTRA Toolbox is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-The ASTRA Toolbox is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
-
------------------------------------------------------------------------
-$Id$
-*/
-
-#include "dims3d.h"
-
-namespace astra {
-
-// (See declaration in header for (mathematical) description of these functions)
-
-
-void computeBP_UV_Coeffs(const SPar3DProjection& proj, double &fUX, double &fUY, double &fUZ, double &fUC,
- double &fVX, double &fVY, double &fVZ, double &fVC)
-{
- double denom = (proj.fRayX*proj.fDetUY*proj.fDetVZ - proj.fRayX*proj.fDetUZ*proj.fDetVY - proj.fRayY*proj.fDetUX*proj.fDetVZ + proj.fRayY*proj.fDetUZ*proj.fDetVX + proj.fRayZ*proj.fDetUX*proj.fDetVY - proj.fRayZ*proj.fDetUY*proj.fDetVX);
-
- fUX = ( - (proj.fRayY*proj.fDetVZ - proj.fRayZ*proj.fDetVY)) / denom;
- fUY = ( (proj.fRayX*proj.fDetVZ - proj.fRayZ*proj.fDetVX)) / denom;
- fUZ = (- (proj.fRayX*proj.fDetVY - proj.fRayY*proj.fDetVX) ) / denom;
- fUC = (-(proj.fDetSY*proj.fDetVZ - proj.fDetSZ*proj.fDetVY)*proj.fRayX + (proj.fRayY*proj.fDetVZ - proj.fRayZ*proj.fDetVY)*proj.fDetSX - (proj.fRayY*proj.fDetSZ - proj.fRayZ*proj.fDetSY)*proj.fDetVX) / denom;
-
- fVX = ((proj.fRayY*proj.fDetUZ - proj.fRayZ*proj.fDetUY) ) / denom;
- fVY = (- (proj.fRayX*proj.fDetUZ - proj.fRayZ*proj.fDetUX) ) / denom;
- fVZ = ((proj.fRayX*proj.fDetUY - proj.fRayY*proj.fDetUX) ) / denom;
- fVC = ((proj.fDetSY*proj.fDetUZ - proj.fDetSZ*proj.fDetUY)*proj.fRayX - (proj.fRayY*proj.fDetUZ - proj.fRayZ*proj.fDetUY)*proj.fDetSX + (proj.fRayY*proj.fDetSZ - proj.fRayZ*proj.fDetSY)*proj.fDetUX ) / denom;
-}
-
-
-
-void computeBP_UV_Coeffs(const SConeProjection& proj, double &fUX, double &fUY, double &fUZ, double &fUC,
- double &fVX, double &fVY, double &fVZ, double &fVC,
- double &fDX, double &fDY, double &fDZ, double &fDC)
-{
- fUX = (proj.fDetSZ - proj.fSrcZ)*proj.fDetVY - (proj.fDetSY - proj.fSrcY)*proj.fDetVZ;
- fUY = (proj.fDetSX - proj.fSrcX)*proj.fDetVZ -(proj.fDetSZ - proj.fSrcZ)*proj.fDetVX;
- fUZ = (proj.fDetSY - proj.fSrcY)*proj.fDetVX - (proj.fDetSX - proj.fSrcX)*proj.fDetVY;
- fUC = (proj.fDetSY*proj.fDetVZ - proj.fDetSZ*proj.fDetVY)*proj.fSrcX - (proj.fDetSX*proj.fDetVZ - proj.fDetSZ*proj.fDetVX)*proj.fSrcY + (proj.fDetSX*proj.fDetVY - proj.fDetSY*proj.fDetVX)*proj.fSrcZ;
-
- fVX = (proj.fDetSY - proj.fSrcY)*proj.fDetUZ-(proj.fDetSZ - proj.fSrcZ)*proj.fDetUY;
- fVY = (proj.fDetSZ - proj.fSrcZ)*proj.fDetUX - (proj.fDetSX - proj.fSrcX)*proj.fDetUZ;
- fVZ = (proj.fDetSX - proj.fSrcX)*proj.fDetUY-(proj.fDetSY - proj.fSrcY)*proj.fDetUX;
- fVC = -(proj.fDetSY*proj.fDetUZ - proj.fDetSZ*proj.fDetUY)*proj.fSrcX + (proj.fDetSX*proj.fDetUZ - proj.fDetSZ*proj.fDetUX)*proj.fSrcY - (proj.fDetSX*proj.fDetUY - proj.fDetSY*proj.fDetUX)*proj.fSrcZ;
-
- fDX = proj.fDetUY*proj.fDetVZ - proj.fDetUZ*proj.fDetVY;
- fDY = proj.fDetUZ*proj.fDetVX - proj.fDetUX*proj.fDetVZ;
- fDZ = proj.fDetUX*proj.fDetVY - proj.fDetUY*proj.fDetVX;
- fDC = -proj.fSrcX * (proj.fDetUY*proj.fDetVZ - proj.fDetUZ*proj.fDetVY) - proj.fSrcY * (proj.fDetUZ*proj.fDetVX - proj.fDetUX*proj.fDetVZ) - proj.fSrcZ * (proj.fDetUX*proj.fDetVY - proj.fDetUY*proj.fDetVX);
-}
-
-}
diff --git a/cuda/3d/dims3d.h b/cuda/3d/dims3d.h
index 9bf0b68..5437a85 100644
--- a/cuda/3d/dims3d.h
+++ b/cuda/3d/dims3d.h
@@ -29,46 +29,7 @@ $Id$
#ifndef _CUDA_CONE_DIMS_H
#define _CUDA_CONE_DIMS_H
-namespace astra {
-
-struct SConeProjection {
- // the source
- double fSrcX, fSrcY, fSrcZ;
-
- // the origin ("bottom left") of the (flat-panel) detector
- double fDetSX, fDetSY, fDetSZ;
-
- // the U-edge of a detector pixel
- double fDetUX, fDetUY, fDetUZ;
-
- // the V-edge of a detector pixel
- double fDetVX, fDetVY, fDetVZ;
-};
-
-struct SPar3DProjection {
- // the ray direction
- double fRayX, fRayY, fRayZ;
-
- // the origin ("bottom left") of the (flat-panel) detector
- double fDetSX, fDetSY, fDetSZ;
-
- // the U-edge of a detector pixel
- double fDetUX, fDetUY, fDetUZ;
-
- // the V-edge of a detector pixel
- double fDetVX, fDetVY, fDetVZ;
-};
-
-void computeBP_UV_Coeffs(const SPar3DProjection& proj, double &fUX, double &fUY, double &fUZ, double &fUC,
- double &fVX, double &fVY, double &fVZ, double &fVC);
-
-void computeBP_UV_Coeffs(const SConeProjection& proj, double &fUX, double &fUY, double &fUZ, double &fUC,
- double &fVX, double &fVY, double &fVZ, double &fVC,
- double &fDX, double &fDY, double &fDZ, double &fDC);
-
-}
-
-
+#include "astra/GeometryUtil3D.h"
namespace astraCUDA3d {