diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-03-02 14:42:34 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-03-02 14:42:34 +0100 |
commit | e468c6c546dbb4d9665ccb95b1571a160753d50e (patch) | |
tree | 0c0544cb4e9f892523b2aed581c7a56510383595 /cuda/3d | |
parent | 24a2b2b0a6a354efd58774a4bce930cb9f90334f (diff) | |
parent | bf5aa06406162656752f031edf3ca90f00ff76dd (diff) | |
download | astra-e468c6c546dbb4d9665ccb95b1571a160753d50e.tar.gz astra-e468c6c546dbb4d9665ccb95b1571a160753d50e.tar.bz2 astra-e468c6c546dbb4d9665ccb95b1571a160753d50e.tar.xz astra-e468c6c546dbb4d9665ccb95b1571a160753d50e.zip |
Merge pull request #24 from wjp/cuda_includes
Untangle cuda and astra includes
Diffstat (limited to 'cuda/3d')
-rw-r--r-- | cuda/3d/dims3d.cu | 74 | ||||
-rw-r--r-- | cuda/3d/dims3d.h | 41 |
2 files changed, 1 insertions, 114 deletions
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 { |