r460: no message
[ctsim.git] / libctsim / projections.cpp
index e9a57282c6224f5716578b97a43a7e25cdd92cfd..f6b8cb15a48fd3b3362d79b89505de4740b96271 100644 (file)
@@ -6,9 +6,9 @@
 **   Date Started: Aug 84
 **
 **  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
+**  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.42 2001/01/10 21:21:53 kevin Exp $
+**  $Id: projections.cpp,v 1.46 2001/01/28 19:10:18 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
@@ -474,20 +474,20 @@ Projections::copyHeader (const char* const filename, std::ostream& os)
   is.readInt16 (signature);
   is.seekg (0);
   if (signature != m_signature) {
-    sys_error (ERR_FATAL, "Illegal signature in projection file %s", filename);
+    sys_error (ERR_SEVERE, "Illegal signature in projection file %s", filename);
     return false;
   }
   
   unsigned char* pHdrData = new unsigned char [sizeHeader];
   is.read (reinterpret_cast<char*>(pHdrData), sizeHeader);
   if (is.fail()) {
-    sys_error (ERR_FATAL, "Error reading header");
+    sys_error (ERR_SEVERE, "Error reading header");
     return false;
   }
   
   os.write (reinterpret_cast<char*>(pHdrData), sizeHeader);
   if (os.fail()) {
-    sys_error (ERR_FATAL, "Error writing header");
+    sys_error (ERR_SEVERE, "Error writing header");
     return false;
   }
   
@@ -637,6 +637,8 @@ Projections::printProjectionData (int startView, int endView)
   if (m_projData != NULL) {
     if (startView < 0)
       startView = 0;
+    if (endView < 0)
+      endView = m_nView - 1;
     if (startView > m_nView - 1)
       startView = m_nView - 1;
     if (endView > m_nView - 1)
@@ -687,7 +689,8 @@ Projections::convertPolar (ImageFile& rIF, int iInterpolationID)
   calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet);
 
   std::complex<double>** ppcDetValue = new std::complex<double>* [m_nView];
-  for (unsigned int iView = 0; iView < m_nView; iView++) {
+  unsigned int iView;
+  for (iView = 0; iView < m_nView; iView++) {
     ppcDetValue[iView] = new std::complex<double> [m_nDet];
     for (unsigned int iDet = 0; iDet < m_nDet; iDet++)
       ppcDetValue[iView][iDet] = std::complex<double>(getDetectorArray (iView).detValues()[iDet], 0);