summaryrefslogtreecommitdiffstats
path: root/src/CudaForwardProjectionAlgorithm3D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CudaForwardProjectionAlgorithm3D.cpp')
-rw-r--r--src/CudaForwardProjectionAlgorithm3D.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp
index bb122e0..e29b5a9 100644
--- a/src/CudaForwardProjectionAlgorithm3D.cpp
+++ b/src/CudaForwardProjectionAlgorithm3D.cpp
@@ -40,6 +40,8 @@ $Id$
#include "astra/ParallelVecProjectionGeometry3D.h"
#include "astra/ConeVecProjectionGeometry3D.h"
+#include "astra/Logging.h"
+
#include "../cuda/3d/astra3d.h"
using namespace std;
@@ -76,40 +78,37 @@ bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg)
ASTRA_ASSERT(_cfg.self);
ConfigStackCheck<CAlgorithm> CC("CudaForwardProjectionAlgorithm3D", this, _cfg);
- XMLNode* node;
+ XMLNode node;
int id;
// sinogram data
- node = _cfg.self->getSingleNode("ProjectionDataId");
+ node = _cfg.self.getSingleNode("ProjectionDataId");
ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No ProjectionDataId tag specified.");
- id = boost::lexical_cast<int>(node->getContent());
+ id = boost::lexical_cast<int>(node.getContent());
m_pProjections = dynamic_cast<CFloat32ProjectionData3DMemory*>(CData3DManager::getSingleton().get(id));
- ASTRA_DELETE(node);
CC.markNodeParsed("ProjectionDataId");
// reconstruction data
- node = _cfg.self->getSingleNode("VolumeDataId");
+ node = _cfg.self.getSingleNode("VolumeDataId");
ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No VolumeDataId tag specified.");
- id = boost::lexical_cast<int>(node->getContent());
+ id = boost::lexical_cast<int>(node.getContent());
m_pVolume = dynamic_cast<CFloat32VolumeData3DMemory*>(CData3DManager::getSingleton().get(id));
- ASTRA_DELETE(node);
CC.markNodeParsed("VolumeDataId");
// optional: projector
- node = _cfg.self->getSingleNode("ProjectorId");
+ node = _cfg.self.getSingleNode("ProjectorId");
if (node) {
- id = boost::lexical_cast<int>(node->getContent());
+ id = boost::lexical_cast<int>(node.getContent());
m_pProjector = CProjector3DManager::getSingleton().get(id);
- ASTRA_DELETE(node);
} else {
m_pProjector = 0; // TODO: or manually construct default projector?
}
CC.markNodeParsed("ProjectorId");
// GPU number
- m_iGPUIndex = (int)_cfg.self->getOptionNumerical("GPUindex", -1);
+ m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1);
CC.markOptionParsed("GPUindex");
- m_iDetectorSuperSampling = (int)_cfg.self->getOptionNumerical("DetectorSuperSampling", 1);
+ m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1);
CC.markOptionParsed("DetectorSuperSampling");
// success
@@ -265,7 +264,7 @@ void CCudaForwardProjectionAlgorithm3D::run(int)
for (int k = 0; k < 2; ++k) {
float fU, fV;
projgeom->projectPoint(fX[i], fY[j], fZ[k], a, fU, fV);
- fprintf(stderr, "%3d %c1,%c1,%c1 -> %12f %12f\n", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV);
+ ASTRA_DEBUG("%3d %c1,%c1,%c1 -> %12f %12f", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV);
}
}
#endif