summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-10 15:11:15 +0100
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-10 15:11:15 +0100
commit150951875c236f95a64fd132c26576bd19daca80 (patch)
treeecafe5eed21bc15e577be9cb16702d1e03d31162 /src
parent535564ccd8b9563fb52be0dff247b99495942f51 (diff)
downloadastra-150951875c236f95a64fd132c26576bd19daca80.tar.gz
astra-150951875c236f95a64fd132c26576bd19daca80.tar.bz2
astra-150951875c236f95a64fd132c26576bd19daca80.tar.xz
astra-150951875c236f95a64fd132c26576bd19daca80.zip
Use new logging API internally instead of printf / iostream
Diffstat (limited to 'src')
-rw-r--r--src/ConeProjectionGeometry3D.cpp4
-rw-r--r--src/Config.cpp7
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp4
-rw-r--r--src/CudaForwardProjectionAlgorithm.cpp4
-rw-r--r--src/CudaForwardProjectionAlgorithm3D.cpp4
-rw-r--r--src/CudaReconstructionAlgorithm2D.cpp4
-rw-r--r--src/FilteredBackProjectionAlgorithm.cpp4
7 files changed, 24 insertions, 7 deletions
diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp
index eb9adcf..13f147b 100644
--- a/src/ConeProjectionGeometry3D.cpp
+++ b/src/ConeProjectionGeometry3D.cpp
@@ -28,6 +28,8 @@ $Id$
#include "astra/ConeProjectionGeometry3D.h"
+#include "astra/Logging.h"
+
#include <boost/lexical_cast.hpp>
#include <cstring>
@@ -257,7 +259,7 @@ void CConeProjectionGeometry3D::projectPoint(float32 fX, float32 fY, float32 fZ,
// Scale fS to detector plane
fU = detectorOffsetXToColIndexFloat( (fS * (m_fOriginSourceDistance + m_fOriginDetectorDistance)) / fD );
- fprintf(stderr, "alpha: %f, D: %f, V: %f, S: %f, U: %f\n", alpha, fD, fV, fS, fU);
+ astra::CLogger::debug(__FILE__,__LINE__,"alpha: %f, D: %f, V: %f, S: %f, U: %f", alpha, fD, fV, fS, fU);
}
diff --git a/src/Config.cpp b/src/Config.cpp
index 653935e..0a85b3c 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -37,6 +37,9 @@ $Id$
#include "astra/Projector2D.h"
#include "astra/Projector3D.h"
+#include "astra/Logging.h"
+#include <sstream>
+
using namespace astra;
using namespace std;
@@ -144,7 +147,9 @@ bool ConfigStackCheck<T>::stopParsing()
nodes.clear();
if (!errors.empty()) {
- cout << "Warning: " << name << ": unused configuration options: " << errors << std::endl;
+ ostringstream os;
+ os << "Warning: " << name << ": unused configuration options: " << errors;
+ astra::CLogger::warn(__FILE__,__LINE__,os.str().c_str());
return false;
}
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp
index 77bd412..26b848e 100644
--- a/src/CudaFilteredBackProjectionAlgorithm.cpp
+++ b/src/CudaFilteredBackProjectionAlgorithm.cpp
@@ -34,6 +34,8 @@ $Id$
#include "astra/AstraObjectManager.h"
#include "../cuda/2d/astra.h"
+#include "astra/Logging.h"
+
using namespace std;
using namespace astra;
@@ -483,7 +485,7 @@ E_FBPFILTER CCudaFilteredBackProjectionAlgorithm::_convertStringToFilter(const c
}
else
{
- cerr << "Failed to convert \"" << _filterType << "\" into a filter." << endl;
+ astra::CLogger::error(__FILE__,__LINE__,"Failed to convert \"%s\" into a filter.",_filterType);
}
return output;
diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp
index ab0d643..1ae6b83 100644
--- a/src/CudaForwardProjectionAlgorithm.cpp
+++ b/src/CudaForwardProjectionAlgorithm.cpp
@@ -42,6 +42,8 @@ $Id$
#include "astra/FanFlatVecProjectionGeometry2D.h"
#include "astra/CudaProjector2D.h"
+#include "astra/Logging.h"
+
using namespace std;
namespace astra {
@@ -104,7 +106,7 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg)
id = boost::lexical_cast<int>(node->getContent());
CProjector2D *projector = CProjector2DManager::getSingleton().get(id);
if (!dynamic_cast<CCudaProjector2D*>(projector)) {
- cout << "Warning: non-CUDA Projector2D passed to FP_CUDA" << std::endl;
+ astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed to FP_CUDA");
}
delete node;
}
diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp
index bb122e0..57e1094 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;
@@ -265,7 +267,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::CLogger::debug(__FILE__,__LINE__,"%3d %c1,%c1,%c1 -> %12f %12f", a, i ? ' ' : '-', j ? ' ' : '-', k ? ' ' : '-', fU, fV);
}
}
#endif
diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp
index d3dedc5..b434e8a 100644
--- a/src/CudaReconstructionAlgorithm2D.cpp
+++ b/src/CudaReconstructionAlgorithm2D.cpp
@@ -37,6 +37,8 @@ $Id$
#include "astra/FanFlatVecProjectionGeometry2D.h"
#include "astra/CudaProjector2D.h"
+#include "astra/Logging.h"
+
#include "../cuda/2d/algo.h"
#include <ctime>
@@ -176,7 +178,7 @@ bool CCudaReconstructionAlgorithm2D::initialize(const Config& _cfg)
id = boost::lexical_cast<int>(node->getContent());
CProjector2D *projector = CProjector2DManager::getSingleton().get(id);
if (!dynamic_cast<CCudaProjector2D*>(projector)) {
- cout << "Warning: non-CUDA Projector2D passed" << std::endl;
+ astra::CLogger::warn(__FILE__,__LINE__,"Warning: non-CUDA Projector2D passed");
}
delete node;
}
diff --git a/src/FilteredBackProjectionAlgorithm.cpp b/src/FilteredBackProjectionAlgorithm.cpp
index 50cf939..47315bb 100644
--- a/src/FilteredBackProjectionAlgorithm.cpp
+++ b/src/FilteredBackProjectionAlgorithm.cpp
@@ -39,6 +39,8 @@ $Id$
#include "astra/Fourier.h"
#include "astra/DataProjector.h"
+#include "astra/Logging.h"
+
using namespace std;
namespace astra {
@@ -133,7 +135,7 @@ bool CFilteredBackProjectionAlgorithm::initialize(const Config& _cfg)
for (int i = 0; i < angleCount; i ++) {
if (projectionIndex[i] > m_pProjector->getProjectionGeometry()->getProjectionAngleCount() -1 )
{
- cout << "Invalid Projection Index" << endl;
+ astra::CLogger::error(__FILE__,__LINE__,"Invalid Projection Index");
return false;
} else {
int orgIndex = (int)projectionIndex[i];