projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r379: no message
[ctsim.git]
/
libctsim
/
projections.cpp
diff --git
a/libctsim/projections.cpp
b/libctsim/projections.cpp
index 4d78cd7e4b68d8e314ec10f8af3d9e7c22eda019..e9a57282c6224f5716578b97a43a7e25cdd92cfd 100644
(file)
--- 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
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.4
0 2001/01/07 23:03:28
kevin Exp $
+** $Id: projections.cpp,v 1.4
2 2001/01/10 21:21:53
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
**
** 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
@@
-404,10
+404,16
@@
Projections::copyViewData (const std::string& filename, std::ostream& os, int st
bool
Projections::copyViewData (const char* const filename, std::ostream& os, int startView, int endView)
{
bool
Projections::copyViewData (const char* const filename, std::ostream& os, int startView, int endView)
{
- frnetorderstream is (filename,
ios::in |
ios::binary);
+ frnetorderstream is (filename,
std::ios::in | std::
ios::binary);
kuint16 sizeHeader, signature;
kuint32 _nView, _nDet;
kuint16 sizeHeader, signature;
kuint32 _nView, _nDet;
+ is.seekg (0);
+ if (is.fail()) {
+ sys_error (ERR_SEVERE, "Unable to read projection file %s", filename);
+ return false;
+ }
+
is.readInt16 (sizeHeader);
is.readInt16 (signature);
is.readInt32 (_nView);
is.readInt16 (sizeHeader);
is.readInt16 (signature);
is.readInt32 (_nView);
@@
-416,7
+422,7
@@
Projections::copyViewData (const char* const filename, std::ostream& os, int sta
int nDet = _nDet;
if (signature != m_signature) {
int nDet = _nDet;
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;
}
return false;
}
@@
-446,9
+452,9
@@
Projections::copyViewData (const char* const filename, std::ostream& os, int sta
delete pViewData;
if (is.fail())
delete pViewData;
if (is.fail())
- sys_error (ERR_
FATAL
, "Error reading projection file");
+ sys_error (ERR_
SEVERE
, "Error reading projection file");
if (os.fail())
if (os.fail())
- sys_error (ERR_
FATAL
, "Error writing projection file");
+ sys_error (ERR_
SEVERE
, "Error writing projection file");
return (! (is.fail() | os.fail()));
}
return (! (is.fail() | os.fail()));
}
@@
-816,9
+822,9
@@
Projections::interpolatePolar (ImageFileArray& v, ImageFileArray& vImag,
v[ix][iy] = 0;
}
} else if (iInterpolationID == POLAR_INTERP_BILINEAR) {
v[ix][iy] = 0;
}
} else if (iInterpolationID == POLAR_INTERP_BILINEAR) {
- int iFloorView =
ppdView[ix][iy]
;
+ int iFloorView =
static_cast<int>(ppdView[ix][iy])
;
double dFracView = ppdView[ix][iy] - iFloorView;
double dFracView = ppdView[ix][iy] - iFloorView;
- int iFloorDet =
ppdDet[ix][iy]
;
+ int iFloorDet =
static_cast<int>(ppdDet[ix][iy])
;
double dFracDet = ppdDet[ix][iy] - iFloorDet;
if (iFloorDet >= 0 && iFloorView >= 0) {
double dFracDet = ppdDet[ix][iy] - iFloorDet;
if (iFloorDet >= 0 && iFloorView >= 0) {