diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-09-15 16:38:08 +0200 |
commit | aa31a06235496c0d808e57c8ce914cb4b640bc6e (patch) | |
tree | 33385e828ddca0b2857bac9e3dac4dd3723a3eee /src | |
parent | f6aa2db83dfea89f9d2cfc6fcbd3da141ee77e02 (diff) | |
parent | 00a1c6118b2d64b867c8e640c295462bcccfc7c9 (diff) | |
download | astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.gz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.bz2 astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.tar.xz astra-aa31a06235496c0d808e57c8ce914cb4b640bc6e.zip |
Merge branch 'master' into parallel_vec
Diffstat (limited to 'src')
85 files changed, 814 insertions, 1093 deletions
diff --git a/src/Algorithm.cpp b/src/Algorithm.cpp index 7b61b8c..5b53d1a 100644 --- a/src/Algorithm.cpp +++ b/src/Algorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Algorithm.h" diff --git a/src/ArtAlgorithm.cpp b/src/ArtAlgorithm.cpp index 526c263..adec638 100644 --- a/src/ArtAlgorithm.cpp +++ b/src/ArtAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ArtAlgorithm.h" diff --git a/src/AstraObjectFactory.cpp b/src/AstraObjectFactory.cpp index 35132d0..0e09d05 100644 --- a/src/AstraObjectFactory.cpp +++ b/src/AstraObjectFactory.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/AstraObjectFactory.h" @@ -32,8 +31,8 @@ using namespace std; namespace astra { -DEFINE_SINGLETON2(CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>); -DEFINE_SINGLETON2(CAstraObjectFactory<CProjector2D, Projector2DTypeList>); -DEFINE_SINGLETON2(CAstraObjectFactory<CProjector3D, Projector3DTypeList>); +DEFINE_SINGLETON2(CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>) +DEFINE_SINGLETON2(CAstraObjectFactory<CProjector2D, Projector2DTypeList>) +DEFINE_SINGLETON2(CAstraObjectFactory<CProjector3D, Projector3DTypeList>) } // end namespace diff --git a/src/AstraObjectManager.cpp b/src/AstraObjectManager.cpp index 46eae4b..274601d 100644 --- a/src/AstraObjectManager.cpp +++ b/src/AstraObjectManager.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/AstraObjectManager.h" @@ -31,13 +30,13 @@ $Id$ namespace astra { -DEFINE_SINGLETON(CProjector2DManager); -DEFINE_SINGLETON(CProjector3DManager); -DEFINE_SINGLETON(CData2DManager); -DEFINE_SINGLETON(CData3DManager); -DEFINE_SINGLETON(CAlgorithmManager); -DEFINE_SINGLETON(CMatrixManager); +DEFINE_SINGLETON(CProjector2DManager) +DEFINE_SINGLETON(CProjector3DManager) +DEFINE_SINGLETON(CData2DManager) +DEFINE_SINGLETON(CData3DManager) +DEFINE_SINGLETON(CAlgorithmManager) +DEFINE_SINGLETON(CMatrixManager) -DEFINE_SINGLETON(CAstraIndexManager); +DEFINE_SINGLETON(CAstraIndexManager) } // end namespace diff --git a/src/AsyncAlgorithm.cpp b/src/AsyncAlgorithm.cpp index b265f59..54083a3 100644 --- a/src/AsyncAlgorithm.cpp +++ b/src/AsyncAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/AsyncAlgorithm.h" diff --git a/src/BackProjectionAlgorithm.cpp b/src/BackProjectionAlgorithm.cpp index c9beee1..c510858 100644 --- a/src/BackProjectionAlgorithm.cpp +++ b/src/BackProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/BackProjectionAlgorithm.h" diff --git a/src/CglsAlgorithm.cpp b/src/CglsAlgorithm.cpp index 1ca2549..621e004 100644 --- a/src/CglsAlgorithm.cpp +++ b/src/CglsAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CglsAlgorithm.h" diff --git a/src/CompositeGeometryManager.cpp b/src/CompositeGeometryManager.cpp index 7c4f8e6..a4dace2 100644 --- a/src/CompositeGeometryManager.cpp +++ b/src/CompositeGeometryManager.cpp @@ -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. @@ -39,6 +39,8 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. #include "astra/CudaProjector3D.h" #include "astra/Float32ProjectionData3DMemory.h" #include "astra/Float32VolumeData3DMemory.h" +#include "astra/Float32ProjectionData3DGPU.h" +#include "astra/Float32VolumeData3DGPU.h" #include "astra/Logging.h" #include "../cuda/3d/mem3d.h" @@ -97,6 +99,127 @@ CCompositeGeometryManager::CCompositeGeometryManager() // (First approach: 0.5/0.5) + + + +class _AstraExport CFloat32CustomGPUMemory { +public: + astraCUDA3d::MemHandle3D hnd; // Only required to be valid between allocate/free + virtual bool allocateGPUMemory(unsigned int x, unsigned int y, unsigned int z, astraCUDA3d::Mem3DZeroMode zero)=0; + virtual bool copyToGPUMemory(const astraCUDA3d::SSubDimensions3D &pos)=0; + virtual bool copyFromGPUMemory(const astraCUDA3d::SSubDimensions3D &pos)=0; + virtual bool freeGPUMemory()=0; + virtual ~CFloat32CustomGPUMemory() { } +}; + +class CFloat32ExistingGPUMemory : public astra::CFloat32CustomGPUMemory { +public: + CFloat32ExistingGPUMemory(CFloat32Data3DGPU *d); + virtual bool allocateGPUMemory(unsigned int x, unsigned int y, unsigned int z, astraCUDA3d::Mem3DZeroMode zero); + virtual bool copyToGPUMemory(const astraCUDA3d::SSubDimensions3D &pos); + virtual bool copyFromGPUMemory(const astraCUDA3d::SSubDimensions3D &pos); + virtual bool freeGPUMemory(); + +protected: + unsigned int x, y, z; +}; + +class CFloat32DefaultGPUMemory : public astra::CFloat32CustomGPUMemory { +public: + CFloat32DefaultGPUMemory(CFloat32Data3DMemory* d) { + ptr = d->getData(); + } + virtual bool allocateGPUMemory(unsigned int x, unsigned int y, unsigned int z, astraCUDA3d::Mem3DZeroMode zero) { + hnd = astraCUDA3d::allocateGPUMemory(x, y, z, zero); + return (bool)hnd; + } + virtual bool copyToGPUMemory(const astraCUDA3d::SSubDimensions3D &pos) { + return astraCUDA3d::copyToGPUMemory(ptr, hnd, pos); + } + virtual bool copyFromGPUMemory(const astraCUDA3d::SSubDimensions3D &pos) { + return astraCUDA3d::copyFromGPUMemory(ptr, hnd, pos); + } + virtual bool freeGPUMemory() { + return astraCUDA3d::freeGPUMemory(hnd); + } + +protected: + float *ptr; +}; + + + +CFloat32ExistingGPUMemory::CFloat32ExistingGPUMemory(CFloat32Data3DGPU *d) +{ + hnd = d->getHandle(); + x = d->getWidth(); + y = d->getHeight(); + z = d->getDepth(); +} + +bool CFloat32ExistingGPUMemory::allocateGPUMemory(unsigned int x_, unsigned int y_, unsigned int z_, astraCUDA3d::Mem3DZeroMode zero) { + assert(x_ == x); + assert(y_ == y); + assert(z_ == z); + + if (zero == astraCUDA3d::INIT_ZERO) + return astraCUDA3d::zeroGPUMemory(hnd, x, y, z); + else + return true; +} +bool CFloat32ExistingGPUMemory::copyToGPUMemory(const astraCUDA3d::SSubDimensions3D &pos) { + assert(pos.nx == x); + assert(pos.ny == y); + assert(pos.nz == z); + assert(pos.pitch == x); + assert(pos.subx == 0); + assert(pos.suby == 0); + assert(pos.subnx == x); + assert(pos.subny == y); + + // These are less necessary than x/y, but allowing access to + // subvolumes needs an interface change + assert(pos.subz == 0); + assert(pos.subnz == z); + + return true; +} +bool CFloat32ExistingGPUMemory::copyFromGPUMemory(const astraCUDA3d::SSubDimensions3D &pos) { + assert(pos.nx == x); + assert(pos.ny == y); + assert(pos.nz == z); + assert(pos.pitch == x); + assert(pos.subx == 0); + assert(pos.suby == 0); + assert(pos.subnx == x); + assert(pos.subny == y); + + // These are less necessary than x/y, but allowing access to + // subvolumes needs an interface change + assert(pos.subz == 0); + assert(pos.subnz == z); + + return true; +} +bool CFloat32ExistingGPUMemory::freeGPUMemory() { + return true; +} + + +CFloat32CustomGPUMemory * createGPUMemoryHandler(CFloat32Data3D *d) { + CFloat32Data3DMemory *dMem = dynamic_cast<CFloat32Data3DMemory*>(d); + CFloat32Data3DGPU *dGPU = dynamic_cast<CFloat32Data3DGPU*>(d); + + if (dMem) + return new CFloat32DefaultGPUMemory(dMem); + else + return new CFloat32ExistingGPUMemory(dGPU); +} + + + + + bool CCompositeGeometryManager::splitJobs(TJobSet &jobs, size_t maxSize, int div, TJobSet &split) { int maxBlockDim = astraCUDA3d::maxBlockDimension(); @@ -205,6 +328,7 @@ static std::pair<double, double> reduceProjectionVertical(const CVolumeGeometry3 // reduce self to only cover intersection with projection of VolumePart // (Project corners of volume, take bounding box) + assert(pProjGeom->getProjectionCount() > 0); for (int i = 0; i < pProjGeom->getProjectionCount(); ++i) { double vol_u[8]; @@ -280,7 +404,7 @@ CCompositeGeometryManager::CVolumePart::~CVolumePart() delete pGeom; } -void CCompositeGeometryManager::CVolumePart::getDims(size_t &x, size_t &y, size_t &z) +void CCompositeGeometryManager::CVolumePart::getDims(size_t &x, size_t &y, size_t &z) const { if (!pGeom) { x = y = z = 0; @@ -292,13 +416,28 @@ void CCompositeGeometryManager::CVolumePart::getDims(size_t &x, size_t &y, size_ z = pGeom->getGridSliceCount(); } -size_t CCompositeGeometryManager::CPart::getSize() +size_t CCompositeGeometryManager::CPart::getSize() const { size_t x, y, z; getDims(x, y, z); return x * y * z; } +bool CCompositeGeometryManager::CPart::isFull() const +{ + size_t x, y, z; + getDims(x, y, z); + return x == (size_t)pData->getWidth() && + y == (size_t)pData->getHeight() && + z == (size_t)pData->getDepth(); +} + +bool CCompositeGeometryManager::CPart::canSplitAndReduce() const +{ + return dynamic_cast<CFloat32Data3DMemory *>(pData) != 0; +} + + static bool testVolumeRange(const std::pair<double, double>& fullRange, const CVolumeGeometry3D *pVolGeom, @@ -334,6 +473,9 @@ static bool testVolumeRange(const std::pair<double, double>& fullRange, CCompositeGeometryManager::CPart* CCompositeGeometryManager::CVolumePart::reduce(const CPart *_other) { + if (!canSplitAndReduce()) + return clone(); + const CProjectionPart *other = dynamic_cast<const CProjectionPart *>(_other); assert(other); @@ -654,7 +796,7 @@ static CProjectionGeometry3D* getSubProjectionGeometryV(const CProjectionGeometr // - maybe all approximately the same size? void CCompositeGeometryManager::CVolumePart::splitX(CCompositeGeometryManager::TPartList& out, size_t maxSize, size_t maxDim, int div) { - if (true) { + if (canSplitAndReduce()) { // Split in vertical direction only at first, until we figure out // a model for splitting in other directions @@ -664,7 +806,7 @@ void CCompositeGeometryManager::CVolumePart::splitX(CCompositeGeometryManager::T size_t blockSize = computeLinearSplit(m, div, sliceCount); int rem = blockSize - (sliceCount % blockSize); - if (rem == blockSize) + if ((size_t)rem == blockSize) rem = 0; ASTRA_DEBUG("From %d to %d step %d", -(rem / 2), sliceCount, blockSize); @@ -698,12 +840,14 @@ void CCompositeGeometryManager::CVolumePart::splitX(CCompositeGeometryManager::T out.push_back(boost::shared_ptr<CPart>(sub)); } + } else { + out.push_back(boost::shared_ptr<CPart>(clone())); } } void CCompositeGeometryManager::CVolumePart::splitY(CCompositeGeometryManager::TPartList& out, size_t maxSize, size_t maxDim, int div) { - if (true) { + if (canSplitAndReduce()) { // Split in vertical direction only at first, until we figure out // a model for splitting in other directions @@ -713,7 +857,7 @@ void CCompositeGeometryManager::CVolumePart::splitY(CCompositeGeometryManager::T size_t blockSize = computeLinearSplit(m, div, sliceCount); int rem = blockSize - (sliceCount % blockSize); - if (rem == blockSize) + if ((size_t)rem == blockSize) rem = 0; ASTRA_DEBUG("From %d to %d step %d", -(rem / 2), sliceCount, blockSize); @@ -747,12 +891,14 @@ void CCompositeGeometryManager::CVolumePart::splitY(CCompositeGeometryManager::T out.push_back(boost::shared_ptr<CPart>(sub)); } + } else { + out.push_back(boost::shared_ptr<CPart>(clone())); } } void CCompositeGeometryManager::CVolumePart::splitZ(CCompositeGeometryManager::TPartList& out, size_t maxSize, size_t maxDim, int div) { - if (true) { + if (canSplitAndReduce()) { // Split in vertical direction only at first, until we figure out // a model for splitting in other directions @@ -762,7 +908,7 @@ void CCompositeGeometryManager::CVolumePart::splitZ(CCompositeGeometryManager::T size_t blockSize = computeLinearSplit(m, div, sliceCount); int rem = blockSize - (sliceCount % blockSize); - if (rem == blockSize) + if ((size_t)rem == blockSize) rem = 0; ASTRA_DEBUG("From %d to %d step %d", -(rem / 2), sliceCount, blockSize); @@ -796,6 +942,8 @@ void CCompositeGeometryManager::CVolumePart::splitZ(CCompositeGeometryManager::T out.push_back(boost::shared_ptr<CPart>(sub)); } + } else { + out.push_back(boost::shared_ptr<CPart>(clone())); } } @@ -815,7 +963,7 @@ CCompositeGeometryManager::CProjectionPart::~CProjectionPart() delete pGeom; } -void CCompositeGeometryManager::CProjectionPart::getDims(size_t &x, size_t &y, size_t &z) +void CCompositeGeometryManager::CProjectionPart::getDims(size_t &x, size_t &y, size_t &z) const { if (!pGeom) { x = y = z = 0; @@ -831,6 +979,9 @@ void CCompositeGeometryManager::CProjectionPart::getDims(size_t &x, size_t &y, s CCompositeGeometryManager::CPart* CCompositeGeometryManager::CProjectionPart::reduce(const CPart *_other) { + if (!canSplitAndReduce()) + return clone(); + const CVolumePart *other = dynamic_cast<const CVolumePart *>(_other); assert(other); @@ -868,7 +1019,7 @@ CCompositeGeometryManager::CPart* CCompositeGeometryManager::CProjectionPart::re void CCompositeGeometryManager::CProjectionPart::splitX(CCompositeGeometryManager::TPartList &out, size_t maxSize, size_t maxDim, int div) { - if (true) { + if (canSplitAndReduce()) { // Split in vertical direction only at first, until we figure out // a model for splitting in other directions @@ -878,7 +1029,7 @@ void CCompositeGeometryManager::CProjectionPart::splitX(CCompositeGeometryManage size_t blockSize = computeLinearSplit(m, div, sliceCount); int rem = blockSize - (sliceCount % blockSize); - if (rem == blockSize) + if ((size_t)rem == blockSize) rem = 0; ASTRA_DEBUG("From %d to %d step %d", -(rem / 2), sliceCount, blockSize); @@ -903,6 +1054,8 @@ void CCompositeGeometryManager::CProjectionPart::splitX(CCompositeGeometryManage out.push_back(boost::shared_ptr<CPart>(sub)); } + } else { + out.push_back(boost::shared_ptr<CPart>(clone())); } } @@ -914,7 +1067,7 @@ void CCompositeGeometryManager::CProjectionPart::splitY(CCompositeGeometryManage void CCompositeGeometryManager::CProjectionPart::splitZ(CCompositeGeometryManager::TPartList &out, size_t maxSize, size_t maxDim, int div) { - if (true) { + if (canSplitAndReduce()) { // Split in vertical direction only at first, until we figure out // a model for splitting in other directions @@ -924,7 +1077,7 @@ void CCompositeGeometryManager::CProjectionPart::splitZ(CCompositeGeometryManage size_t blockSize = computeLinearSplit(m, div, sliceCount); int rem = blockSize - (sliceCount % blockSize); - if (rem == blockSize) + if ((size_t)rem == blockSize) rem = 0; ASTRA_DEBUG("From %d to %d step %d", -(rem / 2), sliceCount, blockSize); @@ -949,6 +1102,8 @@ void CCompositeGeometryManager::CProjectionPart::splitZ(CCompositeGeometryManage out.push_back(boost::shared_ptr<CPart>(sub)); } + } else { + out.push_back(boost::shared_ptr<CPart>(clone())); } } @@ -959,8 +1114,8 @@ CCompositeGeometryManager::CProjectionPart* CCompositeGeometryManager::CProjecti } CCompositeGeometryManager::SJob CCompositeGeometryManager::createJobFP(CProjector3D *pProjector, - CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData) + CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData) { ASTRA_DEBUG("CCompositeGeometryManager::createJobFP"); // Create single job for FP @@ -992,8 +1147,8 @@ CCompositeGeometryManager::SJob CCompositeGeometryManager::createJobFP(CProjecto } CCompositeGeometryManager::SJob CCompositeGeometryManager::createJobBP(CProjector3D *pProjector, - CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData) + CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData) { ASTRA_DEBUG("CCompositeGeometryManager::createJobBP"); // Create single job for BP @@ -1022,8 +1177,8 @@ CCompositeGeometryManager::SJob CCompositeGeometryManager::createJobBP(CProjecto return BP; } -bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData) +bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData) { TJobList L; L.push_back(createJobFP(pProjector, pVolData, pProjData)); @@ -1031,8 +1186,8 @@ bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, CFloat32VolumeDat return doJobs(L); } -bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData) +bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData) { TJobList L; L.push_back(createJobBP(pProjector, pVolData, pProjData)); @@ -1041,8 +1196,9 @@ bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, CFloat32VolumeDat } -bool CCompositeGeometryManager::doFDK(CProjector3D *pProjector, CFloat32VolumeData3DMemory *pVolData, - CFloat32ProjectionData3DMemory *pProjData, bool bShortScan) +bool CCompositeGeometryManager::doFDK(CProjector3D *pProjector, CFloat32VolumeData3D *pVolData, + CFloat32ProjectionData3D *pProjData, bool bShortScan, + const float *pfFilter) { if (!dynamic_cast<CConeProjectionGeometry3D*>(pProjData->getGeometry())) { ASTRA_ERROR("CCompositeGeometryManager::doFDK: cone geometry required"); @@ -1052,6 +1208,7 @@ bool CCompositeGeometryManager::doFDK(CProjector3D *pProjector, CFloat32VolumeDa SJob job = createJobBP(pProjector, pVolData, pProjData); job.eType = SJob::JOB_FDK; job.FDKSettings.bShortScan = bShortScan; + job.FDKSettings.pfFilter = pfFilter; TJobList L; L.push_back(job); @@ -1059,11 +1216,11 @@ bool CCompositeGeometryManager::doFDK(CProjector3D *pProjector, CFloat32VolumeDa return doJobs(L); } -bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, const std::vector<CFloat32VolumeData3DMemory *>& volData, const std::vector<CFloat32ProjectionData3DMemory *>& projData) +bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, const std::vector<CFloat32VolumeData3D *>& volData, const std::vector<CFloat32ProjectionData3D *>& projData) { ASTRA_DEBUG("CCompositeGeometryManager::doFP, multi-volume"); - std::vector<CFloat32VolumeData3DMemory *>::const_iterator i; + std::vector<CFloat32VolumeData3D *>::const_iterator i; std::vector<boost::shared_ptr<CPart> > inputs; for (i = volData.begin(); i != volData.end(); ++i) { @@ -1077,7 +1234,7 @@ bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, const std::vector inputs.push_back(boost::shared_ptr<CPart>(input)); } - std::vector<CFloat32ProjectionData3DMemory *>::const_iterator j; + std::vector<CFloat32ProjectionData3D *>::const_iterator j; std::vector<boost::shared_ptr<CPart> > outputs; for (j = projData.begin(); j != projData.end(); ++j) { @@ -1113,12 +1270,12 @@ bool CCompositeGeometryManager::doFP(CProjector3D *pProjector, const std::vector return doJobs(L); } -bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, const std::vector<CFloat32VolumeData3DMemory *>& volData, const std::vector<CFloat32ProjectionData3DMemory *>& projData) +bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, const std::vector<CFloat32VolumeData3D *>& volData, const std::vector<CFloat32ProjectionData3D *>& projData) { ASTRA_DEBUG("CCompositeGeometryManager::doBP, multi-volume"); - std::vector<CFloat32VolumeData3DMemory *>::const_iterator i; + std::vector<CFloat32VolumeData3D *>::const_iterator i; std::vector<boost::shared_ptr<CPart> > outputs; for (i = volData.begin(); i != volData.end(); ++i) { @@ -1132,7 +1289,7 @@ bool CCompositeGeometryManager::doBP(CProjector3D *pProjector, const std::vector outputs.push_back(boost::shared_ptr<CPart>(output)); } - std::vector<CFloat32ProjectionData3DMemory *>::const_iterator j; + std::vector<CFloat32ProjectionData3D *>::const_iterator j; std::vector<boost::shared_ptr<CPart> > inputs; for (j = projData.begin(); j != projData.end(); ++j) { @@ -1186,14 +1343,25 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter if (L.begin()->eType == CCompositeGeometryManager::SJob::JOB_NOP) { // just zero output? if (zero) { - for (size_t z = 0; z < outz; ++z) { - for (size_t y = 0; y < outy; ++y) { - float* ptr = output->pData->getData(); - ptr += (z + output->subX) * (size_t)output->pData->getHeight() * (size_t)output->pData->getWidth(); - ptr += (y + output->subY) * (size_t)output->pData->getWidth(); - ptr += output->subX; - memset(ptr, 0, sizeof(float) * outx); + // TODO: This function shouldn't have to know about this difference + // between Memory/GPU + CFloat32Data3DMemory *hostMem = dynamic_cast<CFloat32Data3DMemory *>(output->pData); + if (hostMem) { + for (size_t z = 0; z < outz; ++z) { + for (size_t y = 0; y < outy; ++y) { + float* ptr = hostMem->getData(); + ptr += (z + output->subX) * (size_t)output->pData->getHeight() * (size_t)output->pData->getWidth(); + ptr += (y + output->subY) * (size_t)output->pData->getWidth(); + ptr += output->subX; + memset(ptr, 0, sizeof(float) * outx); + } } + } else { + CFloat32Data3DGPU *gpuMem = dynamic_cast<CFloat32Data3DGPU *>(output->pData); + assert(gpuMem); + assert(output->isFull()); // TODO: zero subset? + + zeroGPUMemory(gpuMem->getHandle(), outx, outy, outz); } } return true; @@ -1212,10 +1380,11 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter dstdims.subx = output->subX; dstdims.suby = output->subY; dstdims.subz = output->subZ; - float *dst = output->pData->getData(); - astraCUDA3d::MemHandle3D outputMem = astraCUDA3d::allocateGPUMemory(outx, outy, outz, zero ? astraCUDA3d::INIT_ZERO : astraCUDA3d::INIT_NO); - bool ok = outputMem; + CFloat32CustomGPUMemory *dstMem = createGPUMemoryHandler(output->pData); + + bool ok = dstMem->allocateGPUMemory(outx, outy, outz, zero ? astraCUDA3d::INIT_ZERO : astraCUDA3d::INIT_NO); + if (!ok) ASTRA_ERROR("Error allocating GPU memory"); for (CCompositeGeometryManager::TJobList::const_iterator i = L.begin(); i != L.end(); ++i) { const CCompositeGeometryManager::SJob &j = *i; @@ -1226,15 +1395,18 @@ 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; j.pInput->getDims(inx, iny, inz); - astraCUDA3d::MemHandle3D inputMem = astraCUDA3d::allocateGPUMemory(inx, iny, inz, astraCUDA3d::INIT_NO); + + CFloat32CustomGPUMemory *srcMem = createGPUMemoryHandler(j.pInput->pData); astraCUDA3d::SSubDimensions3D srcdims; srcdims.nx = j.pInput->pData->getWidth(); @@ -1247,9 +1419,11 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter srcdims.subx = j.pInput->subX; srcdims.suby = j.pInput->subY; srcdims.subz = j.pInput->subZ; - const float *src = j.pInput->pData->getDataConst(); - ok = astraCUDA3d::copyToGPUMemory(src, inputMem, srcdims); + ok = srcMem->allocateGPUMemory(inx, iny, inz, astraCUDA3d::INIT_NO); + if (!ok) ASTRA_ERROR("Error allocating GPU memory"); + + ok = srcMem->copyToGPUMemory(srcdims); if (!ok) ASTRA_ERROR("Error copying input data to GPU"); switch (j.eType) { @@ -1260,7 +1434,7 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter ASTRA_DEBUG("CCompositeGeometryManager::doJobs: doing FP"); - ok = astraCUDA3d::FP(((CCompositeGeometryManager::CProjectionPart*)j.pOutput.get())->pGeom, outputMem, ((CCompositeGeometryManager::CVolumePart*)j.pInput.get())->pGeom, inputMem, detectorSuperSampling, projKernel); + ok = astraCUDA3d::FP(((CCompositeGeometryManager::CProjectionPart*)j.pOutput.get())->pGeom, dstMem->hnd, ((CCompositeGeometryManager::CVolumePart*)j.pInput.get())->pGeom, srcMem->hnd, detectorSuperSampling, projKernel); if (!ok) ASTRA_ERROR("Error performing sub-FP"); ASTRA_DEBUG("CCompositeGeometryManager::doJobs: FP done"); } @@ -1272,7 +1446,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, inputMem, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, outputMem, voxelSuperSampling); + ok = astraCUDA3d::BP(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, srcMem->hnd, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, dstMem->hnd, voxelSuperSampling, densityWeighting); if (!ok) ASTRA_ERROR("Error performing sub-BP"); ASTRA_DEBUG("CCompositeGeometryManager::doJobs: BP done"); } @@ -1288,7 +1462,7 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter } else { ASTRA_DEBUG("CCompositeGeometryManager::doJobs: doing FDK"); - ok = astraCUDA3d::FDK(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, inputMem, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, outputMem, j.FDKSettings.bShortScan); + ok = astraCUDA3d::FDK(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, srcMem->hnd, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, dstMem->hnd, j.FDKSettings.bShortScan, j.FDKSettings.pfFilter); if (!ok) ASTRA_ERROR("Error performing sub-FDK"); ASTRA_DEBUG("CCompositeGeometryManager::doJobs: FDK done"); } @@ -1298,17 +1472,20 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter assert(false); } - ok = astraCUDA3d::freeGPUMemory(inputMem); + ok = srcMem->freeGPUMemory(); if (!ok) ASTRA_ERROR("Error freeing GPU memory"); + delete srcMem; } - ok = astraCUDA3d::copyFromGPUMemory(dst, outputMem, dstdims); + ok = dstMem->copyFromGPUMemory(dstdims); if (!ok) ASTRA_ERROR("Error copying output data from GPU"); - ok = astraCUDA3d::freeGPUMemory(outputMem); + ok = dstMem->freeGPUMemory(); if (!ok) ASTRA_ERROR("Error freeing GPU memory"); + delete dstMem; + return true; } @@ -1451,6 +1628,8 @@ void CCompositeGeometryManager::setGPUIndices(const std::vector<int>& GPUIndices bool CCompositeGeometryManager::doJobs(TJobList &jobs) { + // TODO: Proper clean up if substeps fail (Or as proper as possible) + ASTRA_DEBUG("CCompositeGeometryManager::doJobs"); // Sort job list into job set by output part diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp index 96b04fb..217a916 100644 --- a/src/ConeProjectionGeometry3D.cpp +++ b/src/ConeProjectionGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ConeProjectionGeometry3D.h" diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index f4f900d..d73b8d1 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ConeVecProjectionGeometry3D.h" diff --git a/src/Config.cpp b/src/Config.cpp index 395080b..ec074e9 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Config.h" diff --git a/src/CudaBackProjectionAlgorithm.cpp b/src/CudaBackProjectionAlgorithm.cpp index a73f895..354d17d 100644 --- a/src/CudaBackProjectionAlgorithm.cpp +++ b/src/CudaBackProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaBackProjectionAlgorithm3D.cpp b/src/CudaBackProjectionAlgorithm3D.cpp index 76d7b35..27bb968 100644 --- a/src/CudaBackProjectionAlgorithm3D.cpp +++ b/src/CudaBackProjectionAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaBackProjectionAlgorithm3D.h" @@ -61,8 +60,8 @@ CCudaBackProjectionAlgorithm3D::CCudaBackProjectionAlgorithm3D() //---------------------------------------------------------------------------------------- // Constructor with initialization CCudaBackProjectionAlgorithm3D::CCudaBackProjectionAlgorithm3D(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pProjectionData, - CFloat32VolumeData3DMemory* _pReconstruction) + CFloat32ProjectionData3D* _pProjectionData, + CFloat32VolumeData3D* _pReconstruction) { _clear(); initialize(_pProjector, _pProjectionData, _pReconstruction); @@ -146,8 +145,8 @@ bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg) //---------------------------------------------------------------------------------------- // Initialize - C++ bool CCudaBackProjectionAlgorithm3D::initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pSinogram, - CFloat32VolumeData3DMemory* _pReconstruction) + CFloat32ProjectionData3D* _pSinogram, + CFloat32VolumeData3D* _pReconstruction) { // if already initialized, clear first if (m_bIsInitialized) { @@ -188,17 +187,21 @@ void CCudaBackProjectionAlgorithm3D::run(int _iNrIterations) // check initialized ASTRA_ASSERT(m_bIsInitialized); - CFloat32ProjectionData3DMemory* pSinoMem = dynamic_cast<CFloat32ProjectionData3DMemory*>(m_pSinogram); + CFloat32ProjectionData3D* pSinoMem = dynamic_cast<CFloat32ProjectionData3D*>(m_pSinogram); ASTRA_ASSERT(pSinoMem); - CFloat32VolumeData3DMemory* pReconMem = dynamic_cast<CFloat32VolumeData3DMemory*>(m_pReconstruction); + CFloat32VolumeData3D* pReconMem = dynamic_cast<CFloat32VolumeData3D*>(m_pReconstruction); ASTRA_ASSERT(pReconMem); const CProjectionGeometry3D* projgeom = pSinoMem->getGeometry(); const CVolumeGeometry3D& volgeom = *pReconMem->getGeometry(); if (m_bSIRTWeighting) { - astraCudaBP_SIRTWeighted(pReconMem->getData(), - pSinoMem->getDataConst(), + CFloat32ProjectionData3DMemory* pSinoMemory = dynamic_cast<CFloat32ProjectionData3DMemory*>(m_pSinogram); + ASTRA_ASSERT(pSinoMemory); + CFloat32VolumeData3DMemory* pReconMemory = dynamic_cast<CFloat32VolumeData3DMemory*>(m_pReconstruction); + ASTRA_ASSERT(pReconMemory); + astraCudaBP_SIRTWeighted(pReconMemory->getData(), + pSinoMemory->getDataConst(), &volgeom, projgeom, m_iGPUIndex, m_iVoxelSuperSampling); } else { diff --git a/src/CudaCglsAlgorithm.cpp b/src/CudaCglsAlgorithm.cpp index 9dd4f78..8b5bec6 100644 --- a/src/CudaCglsAlgorithm.cpp +++ b/src/CudaCglsAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaCglsAlgorithm3D.cpp b/src/CudaCglsAlgorithm3D.cpp index 930a71e..c00c47d 100644 --- a/src/CudaCglsAlgorithm3D.cpp +++ b/src/CudaCglsAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaCglsAlgorithm3D.h" diff --git a/src/CudaDartMaskAlgorithm.cpp b/src/CudaDartMaskAlgorithm.cpp index c2a4cca..375d565 100644 --- a/src/CudaDartMaskAlgorithm.cpp +++ b/src/CudaDartMaskAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaDartMaskAlgorithm3D.cpp b/src/CudaDartMaskAlgorithm3D.cpp index dd12c58..0d7b27e 100644 --- a/src/CudaDartMaskAlgorithm3D.cpp +++ b/src/CudaDartMaskAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaDartSmoothingAlgorithm.cpp b/src/CudaDartSmoothingAlgorithm.cpp index 425f0a3..0759ea0 100644 --- a/src/CudaDartSmoothingAlgorithm.cpp +++ b/src/CudaDartSmoothingAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaDartSmoothingAlgorithm3D.cpp b/src/CudaDartSmoothingAlgorithm3D.cpp index df7e0df..b381bc9 100644 --- a/src/CudaDartSmoothingAlgorithm3D.cpp +++ b/src/CudaDartSmoothingAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaDataOperationAlgorithm.cpp b/src/CudaDataOperationAlgorithm.cpp index 82b676b..f9466e2 100644 --- a/src/CudaDataOperationAlgorithm.cpp +++ b/src/CudaDataOperationAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaEMAlgorithm.cpp b/src/CudaEMAlgorithm.cpp index d0afd80..040b29a 100644 --- a/src/CudaEMAlgorithm.cpp +++ b/src/CudaEMAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaFDKAlgorithm3D.cpp b/src/CudaFDKAlgorithm3D.cpp index c7c8ed5..6616a85 100644 --- a/src/CudaFDKAlgorithm3D.cpp +++ b/src/CudaFDKAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaFDKAlgorithm3D.h" @@ -37,8 +36,11 @@ $Id$ #include "astra/Logging.h" #include "../cuda/3d/astra3d.h" +#include "../cuda/2d/fft.h" +#include "../cuda/3d/util3d.h" using namespace std; +using namespace astraCUDA3d; namespace astra { @@ -57,8 +59,8 @@ CCudaFDKAlgorithm3D::CCudaFDKAlgorithm3D() //---------------------------------------------------------------------------------------- // Constructor with initialization CCudaFDKAlgorithm3D::CCudaFDKAlgorithm3D(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pProjectionData, - CFloat32VolumeData3DMemory* _pReconstruction) + CFloat32ProjectionData3D* _pProjectionData, + CFloat32VolumeData3D* _pReconstruction) { _clear(); initialize(_pProjector, _pProjectionData, _pReconstruction); @@ -141,6 +143,28 @@ bool CCudaFDKAlgorithm3D::initialize(const Config& _cfg) CC.markOptionParsed("GPUIndex"); if (!_cfg.self.hasOption("GPUIndex")) CC.markOptionParsed("GPUindex"); + + // filter + if (_cfg.self.hasOption("FilterSinogramId")){ + m_iFilterDataId = (int)_cfg.self.getOptionInt("FilterSinogramId"); + const CFloat32ProjectionData2D * pFilterData = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(m_iFilterDataId)); + if (!pFilterData){ + ASTRA_ERROR("Incorrect FilterSinogramId"); + return false; + } + const CProjectionGeometry3D* projgeom = m_pSinogram->getGeometry(); + const CProjectionGeometry2D* filtgeom = pFilterData->getGeometry(); + int iPaddedDetCount = calcNextPowerOfTwo(2 * projgeom->getDetectorColCount()); + int iHalfFFTSize = astraCUDA::calcFFTFourierSize(iPaddedDetCount); + if(filtgeom->getDetectorCount()!=iHalfFFTSize || filtgeom->getProjectionAngleCount()!=projgeom->getProjectionCount()){ + ASTRA_ERROR("Filter size does not match required size (%i angles, %i detectors)",projgeom->getProjectionCount(),iHalfFFTSize); + return false; + } + }else + { + m_iFilterDataId = -1; + } + CC.markOptionParsed("FilterSinogramId"); @@ -155,8 +179,8 @@ bool CCudaFDKAlgorithm3D::initialize(const Config& _cfg) //---------------------------------------------------------------------------------------- // Initialize - C++ bool CCudaFDKAlgorithm3D::initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pSinogram, - CFloat32VolumeData3DMemory* _pReconstruction) + CFloat32ProjectionData3D* _pSinogram, + CFloat32VolumeData3D* _pReconstruction) { // if already initialized, clear first if (m_bIsInitialized) { @@ -197,29 +221,35 @@ void CCudaFDKAlgorithm3D::run(int _iNrIterations) const CProjectionGeometry3D* projgeom = m_pSinogram->getGeometry(); const CConeProjectionGeometry3D* conegeom = dynamic_cast<const CConeProjectionGeometry3D*>(projgeom); - const CVolumeGeometry3D& volgeom = *m_pReconstruction->getGeometry(); + // const CVolumeGeometry3D& volgeom = *m_pReconstruction->getGeometry(); ASTRA_ASSERT(conegeom); - CFloat32ProjectionData3DMemory* pSinoMem = dynamic_cast<CFloat32ProjectionData3DMemory*>(m_pSinogram); + CFloat32ProjectionData3D* pSinoMem = dynamic_cast<CFloat32ProjectionData3D*>(m_pSinogram); ASTRA_ASSERT(pSinoMem); - CFloat32VolumeData3DMemory* pReconMem = dynamic_cast<CFloat32VolumeData3DMemory*>(m_pReconstruction); + CFloat32VolumeData3D* pReconMem = dynamic_cast<CFloat32VolumeData3D*>(m_pReconstruction); ASTRA_ASSERT(pReconMem); + const float *filter = NULL; + if (m_iFilterDataId != -1) { + const CFloat32ProjectionData2D *pFilterData = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(m_iFilterDataId)); + if (pFilterData) + filter = pFilterData->getDataConst(); + } #if 0 bool ok = true; - + ok = astraCudaFDK(pReconMem->getData(), pSinoMem->getDataConst(), &volgeom, conegeom, - m_bShortScan, m_iGPUIndex, m_iVoxelSuperSampling); + m_bShortScan, m_iGPUIndex, m_iVoxelSuperSampling, filter); ASTRA_ASSERT(ok); #endif CCompositeGeometryManager cgm; - cgm.doFDK(m_pProjector, pReconMem, pSinoMem, m_bShortScan); + cgm.doFDK(m_pProjector, pReconMem, pSinoMem, m_bShortScan, filter); diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 9d23253..2829b7d 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include <astra/CudaFilteredBackProjectionAlgorithm.h> diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index bdd7dd0..f4cafe6 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaForwardProjectionAlgorithm.h" diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp index f709e34..ce808eb 100644 --- a/src/CudaForwardProjectionAlgorithm3D.cpp +++ b/src/CudaForwardProjectionAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaForwardProjectionAlgorithm3D.h" @@ -102,14 +101,14 @@ bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg) node = _cfg.self.getSingleNode("ProjectionDataId"); ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No ProjectionDataId tag specified."); id = node.getContentInt(); - m_pProjections = dynamic_cast<CFloat32ProjectionData3DMemory*>(CData3DManager::getSingleton().get(id)); + m_pProjections = dynamic_cast<CFloat32ProjectionData3D*>(CData3DManager::getSingleton().get(id)); CC.markNodeParsed("ProjectionDataId"); // reconstruction data node = _cfg.self.getSingleNode("VolumeDataId"); ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No VolumeDataId tag specified."); id = node.getContentInt(); - m_pVolume = dynamic_cast<CFloat32VolumeData3DMemory*>(CData3DManager::getSingleton().get(id)); + m_pVolume = dynamic_cast<CFloat32VolumeData3D*>(CData3DManager::getSingleton().get(id)); CC.markNodeParsed("VolumeDataId"); // optional: projector @@ -141,8 +140,8 @@ bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg) bool CCudaForwardProjectionAlgorithm3D::initialize(CProjector3D* _pProjector, - CFloat32ProjectionData3DMemory* _pProjections, - CFloat32VolumeData3DMemory* _pVolume, + CFloat32ProjectionData3D* _pProjections, + CFloat32VolumeData3D* _pVolume, int _iGPUindex, int _iDetectorSuperSampling) { m_pProjector = _pProjector; diff --git a/src/CudaProjector2D.cpp b/src/CudaProjector2D.cpp index acf6000..b0a38b0 100644 --- a/src/CudaProjector2D.cpp +++ b/src/CudaProjector2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaProjector2D.h" diff --git a/src/CudaProjector3D.cpp b/src/CudaProjector3D.cpp index bbfbd34..a1f091e 100644 --- a/src/CudaProjector3D.cpp +++ b/src/CudaProjector3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaProjector3D.h" @@ -31,6 +30,9 @@ $Id$ #include "astra/VolumeGeometry3D.h" #include "astra/ProjectionGeometry3D.h" +#include "astra/ConeProjectionGeometry3D.h" +#include "astra/ConeVecProjectionGeometry3D.h" + namespace astra { @@ -65,6 +67,7 @@ void CCudaProjector3D::_clear() m_iVoxelSuperSampling = 1; m_iDetectorSuperSampling = 1; m_iGPUIndex = -1; + m_bDensityWeighting = false; } //---------------------------------------------------------------------------------------- @@ -129,6 +132,13 @@ bool CCudaProjector3D::initialize(const Config& _cfg) m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); CC.markOptionParsed("DetectorSuperSampling"); + if (dynamic_cast<CConeProjectionGeometry3D*>(m_pProjectionGeometry) || + dynamic_cast<CConeVecProjectionGeometry3D*>(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"); diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp index 326ef1e..f37647c 100644 --- a/src/CudaReconstructionAlgorithm2D.cpp +++ b/src/CudaReconstructionAlgorithm2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaRoiSelectAlgorithm.cpp b/src/CudaRoiSelectAlgorithm.cpp index dfb8056..baf8a6f 100644 --- a/src/CudaRoiSelectAlgorithm.cpp +++ b/src/CudaRoiSelectAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaSartAlgorithm.cpp b/src/CudaSartAlgorithm.cpp index bf97224..a768db9 100644 --- a/src/CudaSartAlgorithm.cpp +++ b/src/CudaSartAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA @@ -99,7 +98,7 @@ bool CCudaSartAlgorithm::initialize(const Config& _cfg) } else if (projOrder == "custom") { vector<float32> projOrderList = _cfg.self.getOptionNumericalArray("ProjectionOrderList"); projectionOrder = new int[projOrderList.size()]; - for (int i = 0; i < projOrderList.size(); i++) { + for (unsigned int i = 0; i < projOrderList.size(); i++) { projectionOrder[i] = static_cast<int>(projOrderList[i]); } sart->setProjectionOrder(projectionOrder, projectionCount); diff --git a/src/CudaSirtAlgorithm.cpp b/src/CudaSirtAlgorithm.cpp index c8dc677..b6b427e 100644 --- a/src/CudaSirtAlgorithm.cpp +++ b/src/CudaSirtAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifdef ASTRA_CUDA diff --git a/src/CudaSirtAlgorithm3D.cpp b/src/CudaSirtAlgorithm3D.cpp index c819f8e..f2d8232 100644 --- a/src/CudaSirtAlgorithm3D.cpp +++ b/src/CudaSirtAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/CudaSirtAlgorithm3D.h" diff --git a/src/DataProjector.cpp b/src/DataProjector.cpp index 83d88a2..4290958 100644 --- a/src/DataProjector.cpp +++ b/src/DataProjector.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/DataProjector.h" diff --git a/src/DataProjectorPolicies.cpp b/src/DataProjectorPolicies.cpp index 324ceeb..e719a5e 100644 --- a/src/DataProjectorPolicies.cpp +++ b/src/DataProjectorPolicies.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/DataProjectorPolicies.h" diff --git a/src/FanFlatBeamLineKernelProjector2D.cpp b/src/FanFlatBeamLineKernelProjector2D.cpp index fd4195b..4bfff58 100644 --- a/src/FanFlatBeamLineKernelProjector2D.cpp +++ b/src/FanFlatBeamLineKernelProjector2D.cpp @@ -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,13 +23,13 @@ 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 "astra/FanFlatBeamLineKernelProjector2D.h" #include <cmath> #include <cstring> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/FanFlatBeamStripKernelProjector2D.cpp b/src/FanFlatBeamStripKernelProjector2D.cpp index b48beab..198c0ea 100644 --- a/src/FanFlatBeamStripKernelProjector2D.cpp +++ b/src/FanFlatBeamStripKernelProjector2D.cpp @@ -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,12 +23,12 @@ 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 "astra/FanFlatBeamStripKernelProjector2D.h" #include <cmath> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/FanFlatProjectionGeometry2D.cpp b/src/FanFlatProjectionGeometry2D.cpp index 4eec9c4..697550c 100644 --- a/src/FanFlatProjectionGeometry2D.cpp +++ b/src/FanFlatProjectionGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/FanFlatProjectionGeometry2D.h" diff --git a/src/FanFlatVecProjectionGeometry2D.cpp b/src/FanFlatVecProjectionGeometry2D.cpp index 0b76fc5..b213384 100644 --- a/src/FanFlatVecProjectionGeometry2D.cpp +++ b/src/FanFlatVecProjectionGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/FanFlatVecProjectionGeometry2D.h" diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp index 70462f7..2361379 100644 --- a/src/FilteredBackProjectionAlgorithm.cpp +++ b/src/FilteredBackProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/FilteredBackProjectionAlgorithm.h" diff --git a/src/Float32Data.cpp b/src/Float32Data.cpp index f668a9f..1bb45d8 100644 --- a/src/Float32Data.cpp +++ b/src/Float32Data.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32Data.h" diff --git a/src/Float32Data2D.cpp b/src/Float32Data2D.cpp index c96e5eb..56ea7cc 100644 --- a/src/Float32Data2D.cpp +++ b/src/Float32Data2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32Data2D.h" diff --git a/src/Float32Data3D.cpp b/src/Float32Data3D.cpp index 9142215..cc824bd 100644 --- a/src/Float32Data3D.cpp +++ b/src/Float32Data3D.cpp @@ -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,12 +23,15 @@ 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 "astra/Float32Data3D.h" #include <sstream> +#ifdef ASTRA_CUDA +#include "../../cuda/3d/mem3d.h" +#endif + using namespace std; namespace astra { @@ -61,7 +64,5 @@ std::string CFloat32Data3D::description() const if (getType() == CFloat32Data3D::VOLUME) res << " volume data \t"; return res.str(); } -//---------------------------------------------------------------------------------------- - } // end namespace astra diff --git a/src/Float32Data3DGPU.cpp b/src/Float32Data3DGPU.cpp new file mode 100644 index 0000000..cd9c4ad --- /dev/null +++ b/src/Float32Data3DGPU.cpp @@ -0,0 +1,98 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the 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 "astra/Float32Data3DGPU.h" + +namespace astra { + +//---------------------------------------------------------------------------------------- +// Default constructor. +CFloat32Data3DGPU::CFloat32Data3DGPU() +{ + _clear(); + m_bInitialized = false; +} + +//---------------------------------------------------------------------------------------- +// Destructor. +CFloat32Data3DGPU::~CFloat32Data3DGPU() +{ + if (m_bInitialized) + { + _unInit(); + } +} + +//---------------------------------------------------------------------------------------- +// Initializes an instance of the CFloat32Data3DGPU class with pre-allocated memory +bool CFloat32Data3DGPU::_initialize(int _iWidth, int _iHeight, int _iDepth, astraCUDA3d::MemHandle3D _hnd) +{ + // basic checks + ASTRA_ASSERT(_iWidth > 0); + ASTRA_ASSERT(_iHeight > 0); + ASTRA_ASSERT(_iDepth > 0); + //ASTRA_ASSERT(_pCustomMemory != NULL); + + if (m_bInitialized) { + _unInit(); + } + + // calculate size + m_iWidth = _iWidth; + m_iHeight = _iHeight; + m_iDepth = _iDepth; + m_iSize = (size_t)m_iWidth * m_iHeight * m_iDepth; + + m_hnd = _hnd; + + // initialization complete + return true; +} +//---------------------------------------------------------------------------------------- +// Clear all member variables, setting all numeric variables to 0 and all pointers to NULL. +void CFloat32Data3DGPU::_clear() +{ + m_iWidth = 0; + m_iHeight = 0; + m_iDepth = 0; + m_iSize = 0; + + m_hnd.d.reset(); +} + +//---------------------------------------------------------------------------------------- +// Un-initialize the object, bringing it back in the unitialized state. +void CFloat32Data3DGPU::_unInit() +{ + ASTRA_ASSERT(m_bInitialized); + + _clear(); + m_bInitialized = false; +} + +} // end namespace astra diff --git a/src/Float32Data3DMemory.cpp b/src/Float32Data3DMemory.cpp index 4e851b7..5c5c310 100644 --- a/src/Float32Data3DMemory.cpp +++ b/src/Float32Data3DMemory.cpp @@ -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,11 +23,11 @@ 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 "astra/Float32Data3DMemory.h" #include <iostream> +#include <cstdlib> namespace astra { @@ -76,10 +76,6 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth) m_pCustomMemory = 0; _allocateData(); - // set minmax to default values - m_fGlobalMin = 0.0; - m_fGlobalMax = 0.0; - // initialization complete return true; @@ -167,7 +163,7 @@ bool CFloat32Data3DMemory::_initialize(int _iWidth, int _iHeight, int _iDepth, C ASTRA_ASSERT(_iWidth > 0); ASTRA_ASSERT(_iHeight > 0); ASTRA_ASSERT(_iDepth > 0); - ASTRA_ASSERT(_pCustomMemory != NULL); + //ASTRA_ASSERT(_pCustomMemory != NULL); if (m_bInitialized) { _unInit(); @@ -273,9 +269,6 @@ void CFloat32Data3DMemory::_clear() m_ppfDataRowInd = NULL; m_pppfDataSliceInd = NULL; m_pCustomMemory = NULL; - - //m_fGlobalMin = 0.0f; - //m_fGlobalMax = 0.0f; } //---------------------------------------------------------------------------------------- @@ -290,37 +283,6 @@ void CFloat32Data3DMemory::_unInit() } //---------------------------------------------------------------------------------------- -// Update data statistics, such as minimum and maximum value, after the data has been modified. -void CFloat32Data3DMemory::updateStatistics() -{ - _computeGlobalMinMax(); -} - -//---------------------------------------------------------------------------------------- -// Find the minimum and maximum data value. -void CFloat32Data3DMemory::_computeGlobalMinMax() -{ - // basic checks - ASTRA_ASSERT(m_bInitialized); - ASTRA_ASSERT(m_pfData != NULL); - ASTRA_ASSERT(m_iSize > 0); - - // initial values - m_fGlobalMin = m_pfData[0]; - m_fGlobalMax = m_pfData[0]; - - // loop - size_t i; - float32 v; - for (i = 0; i < m_iSize; ++i) - { - v = m_pfData[i]; - if (v < m_fGlobalMin) m_fGlobalMin = v; - if (v > m_fGlobalMax) m_fGlobalMax = v; - } -} - -//---------------------------------------------------------------------------------------- // Copy the data block pointed to by _pfData to the data block pointed to by m_pfData. void CFloat32Data3DMemory::copyData(const float32* _pfData, size_t _iSize) { diff --git a/src/Float32ProjectionData2D.cpp b/src/Float32ProjectionData2D.cpp index f7f83e3..67571f4 100644 --- a/src/Float32ProjectionData2D.cpp +++ b/src/Float32ProjectionData2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32ProjectionData2D.h" diff --git a/src/Float32ProjectionData3D.cpp b/src/Float32ProjectionData3D.cpp index 680ad55..ba41e10 100644 --- a/src/Float32ProjectionData3D.cpp +++ b/src/Float32ProjectionData3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32ProjectionData3D.h" @@ -48,232 +47,6 @@ CFloat32ProjectionData3D::~CFloat32ProjectionData3D() { m_pGeometry = 0; } -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const CFloat32ProjectionData3D& _data) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); -#ifdef _DEBUG - CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); - int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount(); - - ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); - ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount); -#endif - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue += fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const CFloat32ProjectionData3D& _data) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); -#ifdef _DEBUG - CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); - int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount(); - - ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); - ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount); -#endif - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue -= fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const CFloat32ProjectionData3D& _data) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); -#ifdef _DEBUG - CProjectionGeometry3D * pDataGeometry = _data.getGeometry(); - int iDataProjectionDetectorCount = pDataGeometry->getDetectorTotCount(); - - ASTRA_ASSERT(iProjectionCount == pDataGeometry->getProjectionCount()); - ASTRA_ASSERT(iDetectorCount == iDataProjectionDetectorCount); -#endif - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue *= fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator*=(const float32& _fScalar) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue *= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator/=(const float32& _fScalar) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue /= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator+=(const float32& _fScalar) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue += _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32ProjectionData3D& CFloat32ProjectionData3D::operator-=(const float32& _fScalar) -{ - CProjectionGeometry3D * pThisGeometry = getGeometry(); - - int iProjectionCount = pThisGeometry->getProjectionCount(); - int iDetectorCount = pThisGeometry->getDetectorTotCount(); - - for(int iProjectionIndex = 0; iProjectionIndex < iProjectionCount; iProjectionIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchProjection(iProjectionIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue -= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnProjection(iProjectionIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - void CFloat32ProjectionData3D::changeGeometry(CProjectionGeometry3D* _pGeometry) { if (!m_bInitialized) return; diff --git a/src/Float32ProjectionData3DGPU.cpp b/src/Float32ProjectionData3DGPU.cpp new file mode 100644 index 0000000..0e063d6 --- /dev/null +++ b/src/Float32ProjectionData3DGPU.cpp @@ -0,0 +1,71 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the 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 "astra/Float32ProjectionData3DGPU.h" + +using namespace std; + +namespace astra +{ + +//---------------------------------------------------------------------------------------- +// Default constructor +CFloat32ProjectionData3DGPU::CFloat32ProjectionData3DGPU() : + CFloat32Data3DGPU() +{ + m_pGeometry = NULL; + m_bInitialized = false; +} + +//---------------------------------------------------------------------------------------- +// Create an instance of the CFloat32ProjectionData2D class with pre-allocated data +CFloat32ProjectionData3DGPU::CFloat32ProjectionData3DGPU(CProjectionGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd) +{ + m_bInitialized = false; + m_bInitialized = initialize(_pGeometry, _hnd); +} + + +//---------------------------------------------------------------------------------------- +// Destructor +CFloat32ProjectionData3DGPU::~CFloat32ProjectionData3DGPU() +{ + delete m_pGeometry; + m_pGeometry = 0; +} + +//---------------------------------------------------------------------------------------- +// Initialization +bool CFloat32ProjectionData3DGPU::initialize(CProjectionGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd) +{ + m_pGeometry = _pGeometry->clone(); + m_bInitialized = _initialize(m_pGeometry->getDetectorColCount(), m_pGeometry->getProjectionCount(), m_pGeometry->getDetectorRowCount(), _hnd); + return m_bInitialized; +} + +} // end namespace astra diff --git a/src/Float32ProjectionData3DMemory.cpp b/src/Float32ProjectionData3DMemory.cpp index ee3fc83..69033d5 100644 --- a/src/Float32ProjectionData3DMemory.cpp +++ b/src/Float32ProjectionData3DMemory.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32ProjectionData3DMemory.h" @@ -115,7 +114,7 @@ bool CFloat32ProjectionData3DMemory::initialize(CProjectionGeometry3D* _pGeometr //---------------------------------------------------------------------------------------- // Initialization -bool CFloat32ProjectionData3DMemory::initialize(CProjectionGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +bool CFloat32ProjectionData3DMemory::initialize(CProjectionGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) { m_pGeometry = _pGeometry->clone(); m_bInitialized = _initialize(m_pGeometry->getDetectorColCount(), m_pGeometry->getProjectionCount(), m_pGeometry->getDetectorRowCount(), _pCustomMemory); @@ -132,102 +131,6 @@ CFloat32ProjectionData3DMemory::~CFloat32ProjectionData3DMemory() } //---------------------------------------------------------------------------------------- -// Fetch a projection -CFloat32VolumeData2D* CFloat32ProjectionData3DMemory::fetchProjection(int _iProjectionNr) const -{ - // fetch slice of the geometry - CVolumeGeometry2D volGeom(m_pGeometry->getDetectorColCount(), m_pGeometry->getDetectorRowCount()); - // create new volume data - CFloat32VolumeData2D* res = new CFloat32VolumeData2D(&volGeom); - // copy data - int row, col; - for (row = 0; row < m_pGeometry->getDetectorRowCount(); ++row) { - for (col = 0; col < m_pGeometry->getDetectorColCount(); ++col) { - res->getData()[row*m_pGeometry->getDetectorColCount() + col] = - m_pfData[_iProjectionNr * m_pGeometry->getDetectorColCount() + m_pGeometry->getDetectorColCount()* m_pGeometry->getProjectionCount() * row + col]; - } - } - // return - return res; -} - -//---------------------------------------------------------------------------------------- -// Return a projection -void CFloat32ProjectionData3DMemory::returnProjection(int _iProjectionNr, CFloat32VolumeData2D* _pProjection) -{ - /// TODO: check geometry - // copy data - int row, col; - for (row = 0; row < m_pGeometry->getDetectorRowCount(); ++row) { - for (col = 0; col < m_pGeometry->getDetectorColCount(); ++col) { - m_pfData[_iProjectionNr * m_pGeometry->getDetectorColCount() + m_pGeometry->getDetectorColCount()* m_pGeometry->getProjectionCount() * row + col] = - _pProjection->getData()[row*m_pGeometry->getDetectorColCount() + col]; - } - } -} - -//---------------------------------------------------------------------------------------- -// Fetch a sinogram -CFloat32ProjectionData2D* CFloat32ProjectionData3DMemory::fetchSinogram(int _iSliceNr) const -{ - CParallelProjectionGeometry3D * pParallelProjGeo = (CParallelProjectionGeometry3D *)m_pGeometry; - CParallelProjectionGeometry2D * pProjGeo2D = pParallelProjGeo->createProjectionGeometry2D(); - - // create new projection data - CFloat32ProjectionData2D* res = new CFloat32ProjectionData2D(pProjGeo2D); - // copy data - int row, col; - - int iDetectorColumnCount = m_pGeometry->getDetectorColCount(); - int iProjectionAngleCount = m_pGeometry->getProjectionCount(); - - for (row = 0; row < m_pGeometry->getProjectionCount(); ++row) { - for (col = 0; col < m_pGeometry->getDetectorColCount(); ++col) - { - int iTargetIndex = row * iDetectorColumnCount + col; - int iSourceIndex = _iSliceNr * iDetectorColumnCount * iProjectionAngleCount + row * iDetectorColumnCount + col; - - float32 fStoredValue = m_pfData[iSourceIndex]; - - res->getData()[iTargetIndex] = fStoredValue; - } - } - - delete pProjGeo2D; - - // return - return res; -} - -//---------------------------------------------------------------------------------------- -// Return a sinogram -void CFloat32ProjectionData3DMemory::returnSinogram(int _iSliceNr, CFloat32ProjectionData2D* _pSinogram2D) -{ - /// TODO: check geometry - // copy data - int row, col; - for (row = 0; row < m_pGeometry->getProjectionCount(); ++row) { - for (col = 0; col < m_pGeometry->getDetectorColCount(); ++col) { - m_pfData[_iSliceNr*m_pGeometry->getDetectorColCount()*m_pGeometry->getProjectionCount() + row*m_pGeometry->getDetectorColCount() + col] = - _pSinogram2D->getData()[row*m_pGeometry->getDetectorColCount() + col]; - } - } -} - -//---------------------------------------------------------------------------------------- -// Returns a specific value -float32 CFloat32ProjectionData3DMemory::getDetectorValue(int _iIndex) -{ - return m_pfData[_iIndex]; -} - -//---------------------------------------------------------------------------------------- -// Sets a specific value -void CFloat32ProjectionData3DMemory::setDetectorValue(int _iIndex, float32 _fValue) -{ - m_pfData[_iIndex] = _fValue; -} -//---------------------------------------------------------------------------------------- CFloat32ProjectionData3DMemory& CFloat32ProjectionData3DMemory::operator=(const CFloat32ProjectionData3DMemory& _dataIn) { diff --git a/src/Float32VolumeData2D.cpp b/src/Float32VolumeData2D.cpp index c903c66..e0e14c3 100644 --- a/src/Float32VolumeData2D.cpp +++ b/src/Float32VolumeData2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32VolumeData2D.h" diff --git a/src/Float32VolumeData3D.cpp b/src/Float32VolumeData3D.cpp index bd78001..96e6940 100644 --- a/src/Float32VolumeData3D.cpp +++ b/src/Float32VolumeData3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32VolumeData3D.h" @@ -44,228 +43,6 @@ CFloat32VolumeData3D::~CFloat32VolumeData3D() { } -CFloat32VolumeData3D& CFloat32VolumeData3D::operator+=(const CFloat32VolumeData3D& _data) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); -#ifdef _DEBUG - CVolumeGeometry3D * pDataGeometry = _data.getGeometry(); - int iThisSlicePixelCount = pThisGeometry->getGridRowCount() * pThisGeometry->getGridColCount(); - int iDataSlicePixelCount = pDataGeometry->getGridRowCount() * pDataGeometry->getGridColCount(); - - ASTRA_ASSERT(iSliceCount == pDataGeometry->getGridSliceCount()); - ASTRA_ASSERT(iThisSlicePixelCount == iDataSlicePixelCount); -#endif - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue += fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator-=(const CFloat32VolumeData3D& _data) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); -#ifdef _DEBUG - CVolumeGeometry3D * pDataGeometry = _data.getGeometry(); - int iThisSlicePixelCount = pThisGeometry->getGridRowCount() * pThisGeometry->getGridColCount(); - int iDataSlicePixelCount = pDataGeometry->getGridRowCount() * pDataGeometry->getGridColCount(); - - ASTRA_ASSERT(iSliceCount == pDataGeometry->getGridSliceCount()); - ASTRA_ASSERT(iThisSlicePixelCount == iDataSlicePixelCount); -#endif - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue -= fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator*=(const CFloat32VolumeData3D& _data) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); -#ifdef _DEBUG - CVolumeGeometry3D * pDataGeometry = _data.getGeometry(); - int iThisSlicePixelCount = pThisGeometry->getGridRowCount() * pThisGeometry->getGridColCount(); - int iDataSlicePixelCount = pDataGeometry->getGridRowCount() * pDataGeometry->getGridColCount(); - - ASTRA_ASSERT(iSliceCount == pDataGeometry->getGridSliceCount()); - ASTRA_ASSERT(iThisSlicePixelCount == iDataSlicePixelCount); -#endif - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - CFloat32VolumeData2D * pDataProjection = _data.fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - float32 fDataValue = pDataProjection->getDataConst()[iDetectorIndex]; - - fThisValue *= fDataValue; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - delete pDataProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator*=(const float32& _fScalar) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue *= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator/=(const float32& _fScalar) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue /= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator+=(const float32& _fScalar) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue += _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - -CFloat32VolumeData3D& CFloat32VolumeData3D::operator-=(const float32& _fScalar) -{ - CVolumeGeometry3D * pThisGeometry = getGeometry(); - - int iSliceCount = pThisGeometry->getGridSliceCount(); - - for(int iSliceIndex = 0; iSliceIndex < iSliceCount; iSliceIndex++) - { - CFloat32VolumeData2D * pThisProjection = fetchSliceZ(iSliceIndex); - - for(int iDetectorIndex = 0; iDetectorIndex < iDetectorIndex; iDetectorIndex++) - { - float32 fThisValue = pThisProjection->getData()[iDetectorIndex]; - - fThisValue -= _fScalar; - - pThisProjection->getData()[iDetectorIndex] = fThisValue; - } - - returnSliceZ(iSliceIndex, pThisProjection); - - delete pThisProjection; - } - - return *this; -} - void CFloat32VolumeData3D::changeGeometry(CVolumeGeometry3D* _pGeometry) { if (!m_bInitialized) return; diff --git a/src/Float32VolumeData3DGPU.cpp b/src/Float32VolumeData3DGPU.cpp new file mode 100644 index 0000000..82a222f --- /dev/null +++ b/src/Float32VolumeData3DGPU.cpp @@ -0,0 +1,71 @@ +/* +----------------------------------------------------------------------- +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam + +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox + +This file is part of the 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 "astra/Float32VolumeData3DGPU.h" + +using namespace std; + +namespace astra +{ + +//---------------------------------------------------------------------------------------- +// Default constructor +CFloat32VolumeData3DGPU::CFloat32VolumeData3DGPU() : + CFloat32Data3DGPU() +{ + m_pGeometry = NULL; + m_bInitialized = false; +} + +//---------------------------------------------------------------------------------------- +// Create an instance of the CFloat32VolumeData2D class with pre-allocated data +CFloat32VolumeData3DGPU::CFloat32VolumeData3DGPU(CVolumeGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd) +{ + m_bInitialized = false; + m_bInitialized = initialize(_pGeometry, _hnd); +} + + +//---------------------------------------------------------------------------------------- +// Destructor +CFloat32VolumeData3DGPU::~CFloat32VolumeData3DGPU() +{ + delete m_pGeometry; + m_pGeometry = 0; +} + +//---------------------------------------------------------------------------------------- +// Initialization +bool CFloat32VolumeData3DGPU::initialize(CVolumeGeometry3D* _pGeometry, astraCUDA3d::MemHandle3D _hnd) +{ + m_pGeometry = _pGeometry->clone(); + m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), m_pGeometry->getGridSliceCount(), _hnd); + return m_bInitialized; +} + +} // end namespace astra diff --git a/src/Float32VolumeData3DMemory.cpp b/src/Float32VolumeData3DMemory.cpp index 14adb1a..27ae87b 100644 --- a/src/Float32VolumeData3DMemory.cpp +++ b/src/Float32VolumeData3DMemory.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Float32VolumeData3DMemory.h" @@ -115,103 +114,13 @@ bool CFloat32VolumeData3DMemory::initialize(CVolumeGeometry3D* _pGeometry, float } //---------------------------------------------------------------------------------------- // Initialization -bool CFloat32VolumeData3DMemory::initialize(CVolumeGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) +bool CFloat32VolumeData3DMemory::initialize(CVolumeGeometry3D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) { m_pGeometry = _pGeometry->clone(); m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), m_pGeometry->getGridSliceCount(), _pCustomMemory); return m_bInitialized; } - -//---------------------------------------------------------------------------------------- -// Fetch a slice -CFloat32VolumeData2D * CFloat32VolumeData3DMemory::fetchSliceZ(int _iSliceIndex) const -{ - // fetch slice of the geometry - int iRowCount = m_pGeometry->getGridRowCount(); - int iColumnCount = m_pGeometry->getGridColCount(); - CVolumeGeometry2D volGeom(iColumnCount, iRowCount); - - // create new volume data - CFloat32VolumeData2D* res = new CFloat32VolumeData2D(&volGeom); - - // copy data - float * pfTargetData = res->getData(); - for(int iRowIndex = 0; iRowIndex < iRowCount; iRowIndex++) - { - for(int iColumnIndex = 0; iColumnIndex < iColumnCount; iColumnIndex++) - { - int iSourceIndex = _iSliceIndex * iColumnCount * iRowCount + iRowIndex * iColumnCount + iColumnIndex; - int iTargetIndex = iRowIndex * iColumnCount + iColumnIndex; - float fStoredValue = m_pfData[iSourceIndex]; - pfTargetData[iTargetIndex] = fStoredValue; - } - } - // return - return res; -} - -//---------------------------------------------------------------------------------------- -// Return a slice -void CFloat32VolumeData3DMemory::returnSliceZ(int _iSliceIndex, CFloat32VolumeData2D * _pSlice) -{ - int iRowCount = _pSlice->getGeometry()->getGridRowCount(); - int iColumnCount = _pSlice->getGeometry()->getGridColCount(); - - assert(iRowCount == m_pGeometry->getGridRowCount()); - assert(iColumnCount == m_pGeometry->getGridColCount()); - - for(int iRowIndex = 0; iRowIndex < iRowCount; iRowIndex++) - { - for(int iColumnIndex = 0; iColumnIndex < iColumnCount; iColumnIndex++) - { - int iSourceIndex = iRowIndex * iColumnCount + iColumnIndex; - int iTargetIndex = _iSliceIndex * iColumnCount * iRowCount + iRowIndex * iColumnCount + iColumnIndex; - float fStoredValue = _pSlice->getDataConst()[iSourceIndex]; - m_pfData[iTargetIndex] = fStoredValue; - } - } -} - -CFloat32VolumeData2D * CFloat32VolumeData3DMemory::fetchSliceX(int _iColumnIndex) const -{ - // TODO: - assert(false); - return NULL; -} - -CFloat32VolumeData2D * CFloat32VolumeData3DMemory::fetchSliceY(int _iRowIndex) const -{ - // TODO: - assert(false); - return NULL; -} - -void CFloat32VolumeData3DMemory::returnSliceX(int _iColumnIndex, CFloat32VolumeData2D * _pSliceData) -{ - // TODO: - assert(false); -} - -void CFloat32VolumeData3DMemory::returnSliceY(int _iRowIndex, CFloat32VolumeData2D * _pSliceData) -{ - // TODO: - assert(false); -} - -//---------------------------------------------------------------------------------------- -// Returns a specific value -float32 CFloat32VolumeData3DMemory::getVoxelValue(int _iIndex) -{ - return m_pfData[_iIndex]; -} - -//---------------------------------------------------------------------------------------- -// Sets a specific value -void CFloat32VolumeData3DMemory::setVoxelValue(int _iIndex, float32 _fValue) -{ - m_pfData[_iIndex] = _fValue; -} //---------------------------------------------------------------------------------------- CFloat32VolumeData3DMemory& CFloat32VolumeData3DMemory::operator=(const CFloat32VolumeData3DMemory& _dataIn) diff --git a/src/ForwardProjectionAlgorithm.cpp b/src/ForwardProjectionAlgorithm.cpp index dcf5790..dccd838 100644 --- a/src/ForwardProjectionAlgorithm.cpp +++ b/src/ForwardProjectionAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ForwardProjectionAlgorithm.h" diff --git a/src/Fourier.cpp b/src/Fourier.cpp index c33f7bd..36aa26b 100644 --- a/src/Fourier.cpp +++ b/src/Fourier.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Fourier.h" diff --git a/src/GeometryUtil3D.cpp b/src/GeometryUtil3D.cpp index c6bfd8b..b12c211 100644 --- a/src/GeometryUtil3D.cpp +++ b/src/GeometryUtil3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/GeometryUtil3D.h" diff --git a/src/Globals.cpp b/src/Globals.cpp index 904a459..0edb397 100644 --- a/src/Globals.cpp +++ b/src/Globals.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Globals.h" diff --git a/src/Logging.cpp b/src/Logging.cpp index cd7e3f0..da7ea37 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #define CLOG_MAIN diff --git a/src/ParallelBeamBlobKernelProjector2D.cpp b/src/ParallelBeamBlobKernelProjector2D.cpp index f6741dc..7ff13e9 100644 --- a/src/ParallelBeamBlobKernelProjector2D.cpp +++ b/src/ParallelBeamBlobKernelProjector2D.cpp @@ -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,12 +23,12 @@ 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 "astra/ParallelBeamBlobKernelProjector2D.h" #include <cmath> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/ParallelBeamLineKernelProjector2D.cpp b/src/ParallelBeamLineKernelProjector2D.cpp index 4b5a34f..d11be3d 100644 --- a/src/ParallelBeamLineKernelProjector2D.cpp +++ b/src/ParallelBeamLineKernelProjector2D.cpp @@ -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,12 +23,12 @@ 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 "astra/ParallelBeamLineKernelProjector2D.h" #include <cmath> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/ParallelBeamLinearKernelProjector2D.cpp b/src/ParallelBeamLinearKernelProjector2D.cpp index 4090fb6..137046b 100644 --- a/src/ParallelBeamLinearKernelProjector2D.cpp +++ b/src/ParallelBeamLinearKernelProjector2D.cpp @@ -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,12 +23,12 @@ 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 "astra/ParallelBeamLinearKernelProjector2D.h" #include <cmath> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/ParallelBeamStripKernelProjector2D.cpp b/src/ParallelBeamStripKernelProjector2D.cpp index 68e4017..6ed6ab0 100644 --- a/src/ParallelBeamStripKernelProjector2D.cpp +++ b/src/ParallelBeamStripKernelProjector2D.cpp @@ -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,12 +23,12 @@ 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 "astra/ParallelBeamStripKernelProjector2D.h" #include <cmath> +#include <algorithm> #include "astra/DataProjectorPolicies.h" diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp index e1f93aa..3cc506a 100644 --- a/src/ParallelProjectionGeometry2D.cpp +++ b/src/ParallelProjectionGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ParallelProjectionGeometry2D.h" diff --git a/src/ParallelProjectionGeometry3D.cpp b/src/ParallelProjectionGeometry3D.cpp index 2f80883..4d3af25 100644 --- a/src/ParallelProjectionGeometry3D.cpp +++ b/src/ParallelProjectionGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ParallelProjectionGeometry3D.h" diff --git a/src/ParallelVecProjectionGeometry3D.cpp b/src/ParallelVecProjectionGeometry3D.cpp index 3172818..310f87b 100644 --- a/src/ParallelVecProjectionGeometry3D.cpp +++ b/src/ParallelVecProjectionGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ParallelVecProjectionGeometry3D.h" diff --git a/src/PlatformDepSystemCode.cpp b/src/PlatformDepSystemCode.cpp index 0a5d236..d519068 100644 --- a/src/PlatformDepSystemCode.cpp +++ b/src/PlatformDepSystemCode.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/PlatformDepSystemCode.h" diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp index 1bcfbdb..28bf12e 100644 --- a/src/PluginAlgorithm.cpp +++ b/src/PluginAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/PluginAlgorithm.h" diff --git a/src/ProjectionGeometry2D.cpp b/src/ProjectionGeometry2D.cpp index a306b48..54605a7 100644 --- a/src/ProjectionGeometry2D.cpp +++ b/src/ProjectionGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ProjectionGeometry2D.h" diff --git a/src/ProjectionGeometry3D.cpp b/src/ProjectionGeometry3D.cpp index 281db7c..d595570 100644 --- a/src/ProjectionGeometry3D.cpp +++ b/src/ProjectionGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ProjectionGeometry3D.h" diff --git a/src/Projector2D.cpp b/src/Projector2D.cpp index c8743b5..ced5b84 100644 --- a/src/Projector2D.cpp +++ b/src/Projector2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Projector2D.h" diff --git a/src/Projector3D.cpp b/src/Projector3D.cpp index 5e22105..ecaaafc 100644 --- a/src/Projector3D.cpp +++ b/src/Projector3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Projector3D.h" diff --git a/src/ReconstructionAlgorithm2D.cpp b/src/ReconstructionAlgorithm2D.cpp index 1c6d855..4fb2b2b 100644 --- a/src/ReconstructionAlgorithm2D.cpp +++ b/src/ReconstructionAlgorithm2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ReconstructionAlgorithm2D.h" diff --git a/src/ReconstructionAlgorithm3D.cpp b/src/ReconstructionAlgorithm3D.cpp index 55f1031..4893e01 100644 --- a/src/ReconstructionAlgorithm3D.cpp +++ b/src/ReconstructionAlgorithm3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ReconstructionAlgorithm3D.h" diff --git a/src/ReconstructionAlgorithmMultiSlice2D.cpp b/src/ReconstructionAlgorithmMultiSlice2D.cpp index 39c337f..eb13f46 100644 --- a/src/ReconstructionAlgorithmMultiSlice2D.cpp +++ b/src/ReconstructionAlgorithmMultiSlice2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/ReconstructionAlgorithmMultiSlice2D.h" diff --git a/src/SartAlgorithm.cpp b/src/SartAlgorithm.cpp index 8df3342..5c8f59b 100644 --- a/src/SartAlgorithm.cpp +++ b/src/SartAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/SartAlgorithm.h" diff --git a/src/SirtAlgorithm.cpp b/src/SirtAlgorithm.cpp index ff25648..1fb4aad 100644 --- a/src/SirtAlgorithm.cpp +++ b/src/SirtAlgorithm.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/SirtAlgorithm.h" diff --git a/src/SparseMatrix.cpp b/src/SparseMatrix.cpp index ace978d..9f39aea 100644 --- a/src/SparseMatrix.cpp +++ b/src/SparseMatrix.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include <sstream> diff --git a/src/SparseMatrixProjectionGeometry2D.cpp b/src/SparseMatrixProjectionGeometry2D.cpp index 358c992..4694df1 100644 --- a/src/SparseMatrixProjectionGeometry2D.cpp +++ b/src/SparseMatrixProjectionGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/SparseMatrixProjectionGeometry2D.h" diff --git a/src/SparseMatrixProjector2D.cpp b/src/SparseMatrixProjector2D.cpp index be7e069..7059919 100644 --- a/src/SparseMatrixProjector2D.cpp +++ b/src/SparseMatrixProjector2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/SparseMatrixProjector2D.h" diff --git a/src/Utilities.cpp b/src/Utilities.cpp index 8b0ca94..eb06d8b 100644 --- a/src/Utilities.cpp +++ b/src/Utilities.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/Utilities.h" @@ -121,7 +120,7 @@ void splitString(std::vector<std::string> &items, const std::string& s, size_t current = 0; size_t next; do { - next = s.find_first_of(",;", current); + next = s.find_first_of(delim, current); items.push_back(s.substr(current, next - current)); current = next + 1; } while (next != std::string::npos); diff --git a/src/Vector3D.cpp b/src/Vector3D.cpp index 6176d25..f2c28f2 100644 --- a/src/Vector3D.cpp +++ b/src/Vector3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "../include/astra/Vector3D.h" diff --git a/src/VolumeGeometry2D.cpp b/src/VolumeGeometry2D.cpp index 9d74e47..dd056ae 100644 --- a/src/VolumeGeometry2D.cpp +++ b/src/VolumeGeometry2D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/VolumeGeometry2D.h" @@ -164,13 +163,13 @@ bool CVolumeGeometry2D::initialize(const Config& _cfg) // Required: GridColCount XMLNode node = _cfg.self.getSingleNode("GridColCount"); - ASTRA_CONFIG_CHECK(node, "ReconstructionGeometry2D", "No GridColCount tag specified."); + ASTRA_CONFIG_CHECK(node, "VolumeGeometry2D", "No GridColCount tag specified."); m_iGridColCount = node.getContentInt(); CC.markNodeParsed("GridColCount"); // Required: GridRowCount node = _cfg.self.getSingleNode("GridRowCount"); - ASTRA_CONFIG_CHECK(node, "ReconstructionGeometry2D", "No GridRowCount tag specified."); + ASTRA_CONFIG_CHECK(node, "VolumeGeometry2D", "No GridRowCount tag specified."); m_iGridRowCount = node.getContentInt(); CC.markNodeParsed("GridRowCount"); diff --git a/src/VolumeGeometry3D.cpp b/src/VolumeGeometry3D.cpp index 5d72c24..5890f1e 100644 --- a/src/VolumeGeometry3D.cpp +++ b/src/VolumeGeometry3D.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/VolumeGeometry3D.h" @@ -193,19 +192,19 @@ bool CVolumeGeometry3D::initialize(const Config& _cfg) // Required: GridColCount XMLNode node = _cfg.self.getSingleNode("GridColCount"); - ASTRA_CONFIG_CHECK(node, "ReconstructionGeometry2D", "No GridColCount tag specified."); + ASTRA_CONFIG_CHECK(node, "VolumeGeometry3D", "No GridColCount tag specified."); m_iGridColCount = node.getContentInt(); CC.markNodeParsed("GridColCount"); // Required: GridRowCount node = _cfg.self.getSingleNode("GridRowCount"); - ASTRA_CONFIG_CHECK(node, "ReconstructionGeometry2D", "No GridRowCount tag specified."); + ASTRA_CONFIG_CHECK(node, "VolumeGeometry3D", "No GridRowCount tag specified."); m_iGridRowCount = node.getContentInt(); CC.markNodeParsed("GridRowCount"); // Required: GridRowCount node = _cfg.self.getSingleNode("GridSliceCount"); - ASTRA_CONFIG_CHECK(node, "ReconstructionGeometry2D", "No GridSliceCount tag specified."); + ASTRA_CONFIG_CHECK(node, "VolumeGeometry3D", "No GridSliceCount tag specified."); m_iGridSliceCount = node.getContentInt(); CC.markNodeParsed("GridSliceCount"); diff --git a/src/XMLDocument.cpp b/src/XMLDocument.cpp index 716ed9e..97e9c9d 100644 --- a/src/XMLDocument.cpp +++ b/src/XMLDocument.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/XMLDocument.h" diff --git a/src/XMLNode.cpp b/src/XMLNode.cpp index cf268c2..3b7237f 100644 --- a/src/XMLNode.cpp +++ b/src/XMLNode.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #include "astra/XMLNode.h" @@ -415,8 +414,8 @@ static std::string setContentMatrix_internal(T* _pfMatrix, int _iWidth, int _iHe for (int y = 0; y < _iHeight; ++y) { if (_iWidth > 0) str += StringUtil::toString(_pfMatrix[0*s1 + y*s2]); - for (int x = 1; x < _iWidth; x++) - str += "," + StringUtil::toString(_pfMatrix[x*s1 + y*s2]); + for (int x = 1; x < _iWidth; x++) + str += "," + StringUtil::toString(_pfMatrix[x*s1 + y*s2]); if (y != _iHeight-1) str += ";"; diff --git a/src/swrap.cpp b/src/swrap.cpp index 51dcdb1..c970ab5 100644 --- a/src/swrap.cpp +++ b/src/swrap.cpp @@ -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 <http://www.gnu.org/licenses/>. ----------------------------------------------------------------------- -$Id$ */ #ifndef _MSC_VER |