X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fbackprojectors.cpp;h=1f6e92c1bece4c526d80abdad76e47d1d70a7f75;hp=9e350923ab4594287c868e21ee4c8f4b371bf8a0;hb=08f34bf3ba14d4f436f4d2ef0ee5af1d6eb266ac;hpb=6e9304595677d093974038ffad44f8d54178e741 diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index 9e35092..1f6e92c 100644 --- a/libctsim/backprojectors.cpp +++ b/libctsim/backprojectors.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: backprojectors.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $ +** $Id: backprojectors.cpp,v 1.4 2000/06/25 17:32:24 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -58,11 +58,21 @@ Backprojector::initBackprojector (const Projections& proj, ImageFile& im, const { m_nameBackproject = backprojName; m_nameInterpolation = interpName; + m_pBackprojectImplem = NULL; m_idBackproject = convertBackprojectNameToID (backprojName); + if (m_idBackproject == BPROJ_INVALID) { + m_fail = true; + m_failMessage = "Invalid backprojection name "; + m_failMessage += backprojName; + } m_idInterpolation = convertInterpolationNameToID (interpName); - m_pBackprojectImplem = NULL; + if (m_idInterpolation == INTERP_INVALID) { + m_fail = true; + m_failMessage = "Invalid interpolation name "; + m_failMessage += interpName; + } - if (m_idBackproject == BPROJ_INVALID || m_idInterpolation == INTERP_INVALID) { + if (m_fail || m_idBackproject == BPROJ_INVALID || m_idInterpolation == INTERP_INVALID) { m_fail = true; return false; } @@ -79,6 +89,7 @@ Backprojector::initBackprojector (const Projections& proj, ImageFile& im, const m_pBackprojectImplem = static_cast(new BackprojectIntDiff2 (proj, im, m_idInterpolation)); else { m_fail = true; + m_failMessage = "Unable to select a backprojection method [Backprojector::initBackprojector]"; return false; } @@ -139,7 +150,7 @@ Backprojector::convertInterpolationNameToID (const char* const interpName) else if (strcasecmp (interpName, INTERP_BSPLINE_STR) == 0) interpID = INTERP_BSPLINE; #endif - + return (interpID); }