+ fs.seekp (start_data);
+ if (! fs) {
+ sys_error (ERR_SEVERE, "Error seeking detectory array [detarrayWrite]");
+ return false;
+ }
+
+ fs.writeFloat64 (view_angle);
+ fs.writeInt32 (nDet);
+
+ for (unsigned int i = 0; i < nDet; i++) {
+ kfloat32 detval = detval_ptr[i];
+ fs.writeFloat32 (detval);
+ }
+
+ if (! fs)
+ return (false);
+
+ return true;
+}
+
+/* NAME
+* printProjectionData Print projections data
+*
+* SYNOPSIS
+* printProjectionData ()
+*/
+
+void
+Projections::printProjectionData ()
+{
+ printProjectionData (0, nView() - 1);
+}
+
+void
+Projections::printProjectionData (int startView, int endView)
+{
+ printf("Projections Data\n\n");
+ printf("Description: %s\n", m_remark.c_str());
+ printf("Geometry: %s\n", Scanner::convertGeometryIDToName (m_geometry));
+ printf("nView = %8d nDet = %8d\n", m_nView, m_nDet);
+ printf("focalLength = %8.4f ViewDiameter = %8.4f\n", m_dFocalLength, m_dViewDiameter);
+ printf("fanBeamAngle= %8.4f SourceDetector = %8.4f\n", convertRadiansToDegrees(m_dFanBeamAngle), m_dSourceDetectorLength);
+ printf("rotStart = %8.4f rotInc = %8.4f\n", m_rotStart, m_rotInc);
+ printf("detStart = %8.4f detInc = %8.4f\n", m_detStart, m_detInc);
+ 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)
+ endView = m_nView - 1;
+ for (int ir = startView; ir <= endView - 1; ir++) {
+ printf("View %d: angle %f\n", ir, m_projData[ir]->viewAngle());
+ DetectorValue* detval = m_projData[ir]->detValues();
+ for (int id = 0; id < m_projData[ir]->nDet(); id++)
+ printf("%8.4f ", detval[id]);
+ printf("\n");
+ }
+ }
+}
+
+void
+Projections::printScanInfo (std::ostringstream& os) const
+{
+ os << "Number of detectors: " << m_nDet << "\n";
+ os << "Number of views: " << m_nView<< "\n";
+ os << "Description: " << m_remark.c_str()<< "\n";
+ os << "Geometry: " << Scanner::convertGeometryIDToName (m_geometry)<< "\n";
+ os << "Focal Length: " << m_dFocalLength<< "\n";
+ os << "Source Detector Length: " << m_dSourceDetectorLength << "\n";
+ os << "View Diameter: " << m_dViewDiameter<< "\n";
+ os << "Fan Beam Angle: " << convertRadiansToDegrees(m_dFanBeamAngle) << "\n";
+ os << "detStart: " << m_detStart<< "\n";
+ os << "detInc: " << m_detInc<< "\n";
+ os << "rotStart: " << m_rotStart<< "\n";
+ os << "rotInc: " << m_rotInc<< "\n";
+}
+
+
+bool
+Projections::convertPolar (ImageFile& rIF, int iInterpolationID)
+{
+ unsigned int nx = rIF.nx();
+ unsigned int ny = rIF.ny();
+ ImageFileArray v = rIF.getArray();
+ ImageFileArray vImag = rIF.getImaginaryArray();
+
+ if (! v || nx == 0 || ny == 0)