diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CudaFilteredBackProjectionAlgorithm.cpp | 14 | ||||
-rw-r--r-- | src/Logger.cpp | 77 |
2 files changed, 6 insertions, 85 deletions
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index fcdf860..77bd412 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -34,8 +34,6 @@ $Id$ #include "astra/AstraObjectManager.h" #include "../cuda/2d/astra.h" -#include <astra/Logger.h> - using namespace std; using namespace astra; @@ -105,7 +103,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) } CC.markNodeParsed("FilterType"); ASTRA_DELETE(node); - + // filter node = _cfg.self->getSingleNode("FilterSinogramId"); if(node != NULL) @@ -168,7 +166,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg) CC.markOptionParsed("ShortScan"); } - + m_pFBP = new AstraFBP; @@ -186,7 +184,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D * { clear(); } - + // required classes m_pSinogram = _pSinogram; m_pReconstruction = _pReconstruction; @@ -326,7 +324,7 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) const CVolumeGeometry2D& volgeom = *m_pReconstruction->getGeometry(); ok &= m_pFBP->getReconstruction(m_pReconstruction->getData(), volgeom.getGridColCount()); - + ASTRA_ASSERT(ok); } @@ -335,7 +333,7 @@ bool CCudaFilteredBackProjectionAlgorithm::check() // check pointers ASTRA_CONFIG_CHECK(m_pSinogram, "FBP_CUDA", "Invalid Projection Data Object."); ASTRA_CONFIG_CHECK(m_pReconstruction, "FBP_CUDA", "Invalid Reconstruction Data Object."); - + if((m_eFilter == FILTER_PROJECTION) || (m_eFilter == FILTER_SINOGRAM) || (m_eFilter == FILTER_RPROJECTION) || (m_eFilter == FILTER_RSINOGRAM)) { ASTRA_CONFIG_CHECK(m_pfFilter, "FBP_CUDA", "Invalid filter pointer."); @@ -387,7 +385,7 @@ static bool stringCompareLowerCase(const char * _stringA, const char * _stringB) #else iCmpReturn = strcasecmp(_stringA, _stringB); #endif - + return (iCmpReturn == 0); } diff --git a/src/Logger.cpp b/src/Logger.cpp deleted file mode 100644 index 148e18c..0000000 --- a/src/Logger.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* ------------------------------------------------------------------------ -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/Logger.h> - -using namespace astra; - -const char * g_loggerFileName = "astra_logger.txt"; - -void CLogger::_assureIsInitialized() -{ - if(!m_bInitialized) - { - m_pOutFile = fopen(g_loggerFileName, "r"); - if(m_pOutFile != NULL) - { - // file exists, users wants to log - fclose(m_pOutFile); - m_pOutFile = fopen(g_loggerFileName, "w"); - } - - m_bInitialized = true; - } -} - -void CLogger::writeLine(const char * _text) -{ - _assureIsInitialized(); - - if(m_pOutFile != NULL) - { - fprintf(m_pOutFile, "%s\n", _text); - fflush(m_pOutFile); - } -} - -void CLogger::writeTerminalCUDAError(const char * _fileName, int _iLine, const char * _errString) -{ - char buffer[256]; - - sprintf(buffer, "Cuda error in file '%s' in line %i : %s.", _fileName, _iLine, _errString); - - writeLine(buffer); -} - -CLogger::CLogger() -{ - ; -} - -FILE * CLogger::m_pOutFile = NULL; -bool CLogger::m_bInitialized = false; |