X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=69c4d0807a5065d3136e015ad65740ed5465db79;hp=1d90776a039a15d85479c82b11327b7c0763586f;hb=3fba6928127cd65870bdcd96c8114ad5894247ae;hpb=a8ba12a8c971de1d8cb3ef1c3a7d2d9fcf45affa diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 1d90776..69c4d08 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.10 2000/07/04 18:33:35 kevin Exp $ +** $Id: projections.cpp,v 1.14 2000/07/13 07:03:21 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 @@ -208,7 +208,6 @@ Projections::headerRead (fnetorderstream& fs) if (! fs) return false; - off_t testPos; fs.readInt16 (_hsize); fs.readInt16 (_signature); fs.readInt32 (_nView); @@ -366,7 +365,7 @@ Projections::detarrayRead (fnetorderstream& fs, DetectorArray& darray, const int darray.setViewAngle (view_angle); // darray.setNDet ( nDet); - for (int i = 0; i < nDet; i++) { + for (unsigned int i = 0; i < nDet; i++) { kfloat32 detval; fs.readFloat32 (detval); detval_ptr[i] = detval; @@ -412,7 +411,7 @@ Projections::detarrayWrite (fnetorderstream& fs, const DetectorArray& darray, co fs.writeFloat64 (view_angle); fs.writeInt32 (nDet); - for (int i = 0; i < nDet; i++) { + for (unsigned int i = 0; i < nDet; i++) { kfloat32 detval = detval_ptr[i]; fs.writeFloat32 (detval); } @@ -487,17 +486,16 @@ Projections::printScanInfo (void) const */ bool -Projections::reconstruct (ImageFile& im, const char* const filterName, double filt_param, const char* const filterMethodName, const char* const interpName, int interp_param, const char* const backprojectName, const int trace) +Projections::reconstruct (ImageFile& im, const char* const filterName, double filt_param, const char* const filterMethodName, const int zeropad, const char* const interpName, int interpFactor, const char* const backprojectName, const int trace) { - int nview = m_nView; double detInc = m_detInc; - int n_filteredProj = m_nDet; + int n_filteredProj = m_nDet * interpFactor; double filteredProj [n_filteredProj]; // filtered projections #ifdef HAVE_BSPLINE_INTERP int spline_order = 0, zoom_factor = 0; if (interp_type == I_BSPLINE) { - zoom_factor = interp_param; + zoom_factor = interpFactor; spline_order = 3; zoom_factor = 3; n_filteredProj = (m_nDet - 1) * (zoom_factor + 1) + 1; @@ -505,7 +503,9 @@ Projections::reconstruct (ImageFile& im, const char* const filterName, double fi #endif double filterBW = 1. / detInc; - SignalFilter filter (filterName, filterMethodName, filterBW, m_detInc, m_nDet, filt_param, "spatial", 0); + SignalFilter filter (filterName, filterMethodName, filterBW, m_detInc, m_nDet, filt_param, "spatial", zeropad, interpFactor); + filter.setTraceLevel(trace); + if (filter.fail()) { sys_error (ERR_SEVERE, "%s [Projections::reconstruct]", filter.failMessage().c_str()); return false; @@ -538,7 +538,7 @@ Projections::reconstruct (ImageFile& im, const char* const filterName, double fi } #endif //HAVE_SGP - Backprojector bj (*this, im, backprojectName, interpName); + Backprojector bj (*this, im, backprojectName, interpName, interpFactor); if (bj.fail()) { sys_error (ERR_SEVERE, "%s [Projections::reconstruct]", bj.failMessage().c_str()); return false; @@ -572,8 +572,9 @@ Projections::reconstruct (ImageFile& im, const char* const filterName, double fi ezset ("xporigin .5."); ezset ("xlength .5."); ezset ("box"); + ezset ("grid"); - gid = ezplot (filteredProj, plot_xaxis, m_nDet); + gid = ezplot (filteredProj, plot_xaxis, n_filteredProj); } #endif //HAVE_SGP