r254: Added binary output of projection file elements
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 16 Dec 2000 02:31:00 +0000 (02:31 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 16 Dec 2000 02:31:00 +0000 (02:31 +0000)
ChangeLog
include/Makefile.am
include/fnetorderstream.h
include/projections.h
libctsim/array2dfile.cpp
libctsim/imagefile.cpp
libctsim/projections.cpp
libctsim/scanner.cpp
tools/pjinfo.cpp

index 6703e41d0c17432d3bf8b38a4d79dbef34c8aed6..388af49fa6e5a779704eaea4b5eab0984849dc1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
-2.0.7 - 12/04/00
+2.0.7 - 12/16/00
    Modifications for Microsoft Visual C++ compilation
    Modifications for Microsoft Visual C++ compilation
-   Fix core-dump bug in Array2dFile::labelsCopy() function [Thanks Ian Kay!]
+   Fixed core-dump bug in Array2dFile::labelsCopy() function (Ian Kay)
+   Improved pjinfo to output binary headers and view data, useful when
+       manually compiling changing phantoms during projection process. Thanks to
+       Ian Kay for idea and initial code submission.
        
 2.0.6 - 12/03/00
    Fixed minor compilation problem with procsignal.h
        
 2.0.6 - 12/03/00
    Fixed minor compilation problem with procsignal.h
index bf978a6ee7b8c60489c6059869b7dd9e0ec623da..63726ae89a722992debfcf711842ca976dd8ce3d 100644 (file)
@@ -1,4 +1,4 @@
-noinst_HEADERS=ct.h ezplot.h pol.h sgp.h array2d.h imagefile.h backprojectors.h mpiworld.h fnetorderstream.h phantom.h timer.h sstream scanner.h projections.h ctsupport.h filter.h array2dfile.h trace.h transformmatrix.h procsignal.h reconstruct.h
+noinst_HEADERS=ct.h ezplot.h pol.h sgp.h array2d.h imagefile.h backprojectors.h mpiworld.h fnetorderstream.h phantom.h timer.h sstream_subst scanner.h projections.h ctsupport.h filter.h array2dfile.h trace.h transformmatrix.h procsignal.h reconstruct.h
 
 
 
 
 
 
index b682105b9dfecb322a6f06163148193e5b67a7db..41be6cb8f0b95ba70c34058ac48c7eab2401b179 100644 (file)
@@ -71,6 +71,9 @@ class fnetorderstream : public fstream {
   fnetorderstream (const char* filename, int mode)
     : fstream (filename, mode) {}
 
   fnetorderstream (const char* filename, int mode)
     : fstream (filename, mode) {}
 
+  fnetorderstream (const int fd)
+    : fstream (fd) {}
+
   ~fnetorderstream (void)
       {}
 
   ~fnetorderstream (void)
       {}
 
@@ -91,6 +94,9 @@ class frnetorderstream : public fnetorderstream {
   frnetorderstream (const char* filename, int mode)
     : fnetorderstream (filename, mode) {}
 
   frnetorderstream (const char* filename, int mode)
     : fnetorderstream (filename, mode) {}
 
+  frnetorderstream (const int fd)
+    : fnetorderstream (fd) {}
+
   virtual void writeInt16 (kuint16 n);
   virtual void writeInt32 (kuint32 n);
   virtual void writeFloat32 (kfloat32 n);
   virtual void writeInt16 (kuint16 n);
   virtual void writeInt32 (kuint32 n);
   virtual void writeFloat32 (kfloat32 n);
index 4bad1e4d8be2e4ccc085da1967c06d2418ed93cc..03cb2da92db5ba71d586b9bcb793eaae3bf04caa 100644 (file)
@@ -9,7 +9,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.h,v 1.15 2000/12/04 05:36:57 kevin Exp $
+**  $Id: projections.h,v 1.16 2000/12/16 02:31:00 kevin Exp $
 **
 **
 **  This program is free software; you can redistribute it and/or modify
 **
 **
 **  This program is free software; you can redistribute it and/or modify
@@ -32,8 +32,6 @@
 class Scanner;
 class DetectorArray;
 class Array2dFileLabel;
 class Scanner;
 class DetectorArray;
 class Array2dFileLabel;
-\r
-#include <sstream>\r
 
 
 // Projections
 
 
 // Projections
@@ -47,6 +45,7 @@ class Projections
 
   void initFromScanner (const Scanner& scanner);
 
 
   void initFromScanner (const Scanner& scanner);
 
+  void printProjectionData (int startView, int endView);
   void printProjectionData ();
   void printScanInfo (ostringstream& os) const;
 
   void printProjectionData ();
   void printScanInfo (ostringstream& os) const;
 
@@ -89,6 +88,12 @@ class Projections
   
   const DetectorArray& getDetectorArray (const int iview) const
       { return (*m_projData[iview]); }
   
   const DetectorArray& getDetectorArray (const int iview) const
       { return (*m_projData[iview]); }
+
+  static bool copyHeader (const char* const filename, ostream& os);
+  static bool copyHeader (const string& filename, ostream& os);
+
+  static bool copyViewData (const char* const filename, ostream& os, int startView, int endView);
+  static bool copyViewData (const string& filename, ostream& os, int startView, int endView);
   
  private:
   int m_headerSize;            // Size of disk file header 
   
  private:
   int m_headerSize;            // Size of disk file header 
@@ -116,10 +121,8 @@ class Projections
 
   const static kuint16 m_signature;
 
 
   const static kuint16 m_signature;
 
-  bool headerRead ();
-  bool headerWrite ();
-  bool headerRead (fnetorderstream& fs);
   bool headerWrite (fnetorderstream& fs);
   bool headerWrite (fnetorderstream& fs);
+  bool headerRead (fnetorderstream& fs);
   void newProjData ();
   void deleteProjData ();
 
   void newProjData ();
   void deleteProjData ();
 
index 40be226ee82c45ec0f523f41aa4842ff57fd5c4a..b3538da0b79f610a325c0e7c729884c325fadb70 100644 (file)
@@ -9,7 +9,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: array2dfile.cpp,v 1.18 2000/12/15 22:07:35 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.19 2000/12/16 02:31:00 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
@@ -563,7 +563,7 @@ Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const pszId)
     for (unsigned int i = 0; i < copyFile.getNumLabels(); i++) {
       Array2dFileLabel l (copyFile.labelGet (i));
       string lstr = l.getLabelString();
     for (unsigned int i = 0; i < copyFile.getNumLabels(); i++) {
       Array2dFileLabel l (copyFile.labelGet (i));
       string lstr = l.getLabelString();
-      lstr = idStr + lstr;
+      lstr = id + lstr;
       l.setLabelString (lstr);
       labelAdd (l);
     }
       l.setLabelString (lstr);
       labelAdd (l);
     }
index 803347f2e76f071c8fd1ae6b110ac04a84b61994..851b4fdb6d953efb848259debe3e987cac3c7e84 100644 (file)
@@ -9,7 +9,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: imagefile.cpp,v 1.17 2000/12/06 01:46:43 kevin Exp $
+**  $Id: imagefile.cpp,v 1.18 2000/12/16 02:31:00 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
@@ -256,7 +256,7 @@ ImageFile::statistics (double& min, double& max, double& mean, double& mode, dou
       for (int iy = 0; iy < ny; iy++) {
        int b = static_cast<int>((((v[ix4][iy] - min) / spread) * (nbin - 1)) + 0.5);
        hist[b]++;
       for (int iy = 0; iy < ny; iy++) {
        int b = static_cast<int>((((v[ix4][iy] - min) / spread) * (nbin - 1)) + 0.5);
        hist[b]++;
-       double diff = (v[ix][iy] - mean);
+       double diff = (v[ix4][iy] - mean);
        stddev += diff * diff;
        }
     }
        stddev += diff * diff;
        }
     }
index 7de82039d629517652649bf741ede6ae4a5f454b..49aaa9942b078ea417817adb45789a0de5df26bc 100644 (file)
@@ -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.28 2000/12/06 01:46:43 kevin Exp $
+**  $Id: projections.cpp,v 1.29 2000/12/16 02:31:00 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
@@ -329,6 +329,99 @@ Projections::read (const char* filename)
 }
 
 
 }
 
 
+bool 
+Projections::copyViewData (const string& filename, ostream& os, int startView, int endView)
+{
+    return copyViewData (filename.c_str(), os, startView, endView);
+}
+
+bool 
+Projections::copyViewData (const char* const filename, ostream& os, int startView, int endView)
+{
+  frnetorderstream is (filename, ios::in | ios::binary);
+  kuint16 sizeHeader, signature;
+  kuint32 _nView, _nDet;
+
+  is.readInt16 (sizeHeader);
+  is.readInt16 (signature);
+  is.readInt32 (_nView);
+  is.readInt32 (_nDet);
+  int nView = _nView;
+  int nDet = _nDet;
+
+  if (signature != m_signature) {
+    sys_error (ERR_FATAL, "Illegal signature in projection file %s", filename);
+    return false;
+  }
+
+  if (startView < 0)
+      startView = 0;
+  if (startView > nView - 1)
+      startView = nView;
+  if (endView < 0 || endView > nView - 1)
+      endView = nView - 1;
+
+  if (startView > endView) { // swap if start > end
+      int tempView = endView;
+      endView = startView;
+      startView = tempView;
+  }
+
+  int sizeView = 8 /* view_angle */ + 4 /* nDet */ + (4 * nDet);
+  unsigned char* pViewData = new unsigned char [sizeView];
+
+  for (int i = startView; i <= endView; i++) {
+      is.seekg (sizeHeader + i * sizeView);
+      is.read (pViewData, sizeView);
+      os.write (pViewData, sizeView);
+      if (is.fail() || os.fail())
+         break;
+  }
+
+  delete pViewData;
+  if (is.fail()) 
+    sys_error (ERR_FATAL, "Error reading projection file");
+  if (os.fail()) 
+    sys_error (ERR_FATAL, "Error writing projection file");
+    
+  return (! (is.fail() | os.fail()));
+}
+
+bool 
+Projections::copyHeader (const string& filename, ostream& os)
+{
+    return copyHeader (filename.c_str(), os);
+}
+
+bool
+Projections::copyHeader (const char* const filename, ostream& os)
+{
+  frnetorderstream is (filename, ios::in | ios::binary);
+  kuint16 sizeHeader, signature;
+  is.readInt16 (sizeHeader);
+  is.readInt16 (signature);
+  is.seekg (0);
+  if (signature != m_signature) {
+    sys_error (ERR_FATAL, "Illegal signature in projection file %s", filename);
+    return false;
+  }
+
+  unsigned char* pHdrData = new unsigned char [sizeHeader];
+  is.read (pHdrData, sizeHeader);
+  if (is.fail()) {
+      sys_error (ERR_FATAL, "Error reading header");
+      return false;
+  }
+
+  os.write (pHdrData, sizeHeader);
+  if (os.fail()) {
+      sys_error (ERR_FATAL, "Error writing header");
+      return false;
+  }
+
+  return true;
+}
+
 bool
 Projections::write (const string& filename)
 {
 bool
 Projections::write (const string& filename)
 {
@@ -465,7 +558,13 @@ Projections::detarrayWrite (fnetorderstream& fs, const DetectorArray& darray, co
  */
 
 void
  */
 
 void
-Projections::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("Projections Data\n\n");
   printf("Description: %s\n", m_remark.c_str());
@@ -475,13 +574,19 @@ Projections::printProjectionData (void)
   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) {
   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) {
-      for (int ir = 0; ir < m_nView; 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");
-      }
+    if (startView < 0)
+      startView = 0;
+    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");
+    }
   }
 }
 
   }
 }
 
index c8c86632d1c15924cf9e9f4794ed8be6b9703c9a..48f23943a739ec654d361fba8fdcc35f1fad92d5 100644 (file)
@@ -9,7 +9,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: scanner.cpp,v 1.17 2000/12/06 01:46:43 kevin Exp $
+**  $Id: scanner.cpp,v 1.18 2000/12/16 02:31:00 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
@@ -535,7 +535,7 @@ Scanner::traceShowParamRasterOp (int iRasterOp, const char *szLabel, const char
 #ifdef MSVC
   vsprintf (szValue, fmt, args);
 #else
 #ifdef MSVC
   vsprintf (szValue, fmt, args);
 #else
-  vnsprintf (szValue, sizeof(szValue), fmt, args);
+  vsnprintf (szValue, sizeof(szValue), fmt, args);
 #endif
 
   //  cio_set_cpos (raysum_trace_menu_column, row);
 #endif
 
   //  cio_set_cpos (raysum_trace_menu_column, row);
index 0ca578c05d9c0e01d850f02651576fbaf1b99c47..8a4d0e24b36a12a6bc3a7c6475ccbeb90e7473a9 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
 ** FILE IDENTIFICATION
 **
 /*****************************************************************************
 ** FILE IDENTIFICATION
 **
-**   Name:          pjfinfo.cpp
+**   Name:          pjinfo.cpp
 **   Purpose:       Convert an projection data file to an image file
 **   Programmer:    Kevin Rosenberg
 **   Date Started:  April 2000
 **   Purpose:       Convert an projection data file to an image file
 **   Programmer:    Kevin Rosenberg
 **   Date Started:  April 2000
@@ -9,7 +9,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: pjinfo.cpp,v 1.1 2000/09/02 05:17:29 kevin Exp $
+**  $Id: pjinfo.cpp,v 1.2 2000/12/16 02:31:00 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
@@ -26,7 +26,7 @@
 ******************************************************************************/
 
 /* FILE
 ******************************************************************************/
 
 /* FILE
- *   pjfinfo.c                 Convert Raysum to image
+ *   pjinfo.c                  Convert Raysum to image
  *
  * DATE
  *   August 2000
  *
  * DATE
  *   August 2000
 #include "timer.h"
 
 
 #include "timer.h"
 
 
-enum { O_DUMP, O_HELP, O_VERSION };
+enum { O_BINARYHEADER, O_BINARYVIEWS, O_STARTVIEW, O_ENDVIEW, O_DUMP, O_HELP, O_VERSION };
 
 static struct option my_options[] =
 {
 
 static struct option my_options[] =
 {
+  {"binaryheader", 0, 0, O_BINARYHEADER},
+  {"binaryviews", 0, 0, O_BINARYVIEWS},
+  {"startview", 1, 0, O_STARTVIEW},
+  {"endview", 1, 0, O_ENDVIEW},
   {"dump", 0, 0, O_DUMP},
   {"help", 0, 0, O_HELP},
   {"version", 0, 0, O_VERSION},
   {0, 0, 0, 0}
 };
 
   {"dump", 0, 0, O_DUMP},
   {"help", 0, 0, O_HELP},
   {"version", 0, 0, O_VERSION},
   {0, 0, 0, 0}
 };
 
-static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.1 2000/09/02 05:17:29 kevin Exp $";
+static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.2 2000/12/16 02:31:00 kevin Exp $";
 
 void 
 
 void 
-pjfinfo_usage (const char *program)
+pjinfo_usage (const char *program)
 {
   cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]" << endl;
   cout << "Display projection file information" << endl;
 {
   cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]" << endl;
   cout << "Display projection file information" << endl;
-  cout << endl;
-  cout << "   --dump      Dump all scan data" << endl;
-  cout << "   --version   Print version" << endl;
-  cout << "   --help      Print this help message" << endl;
+  cout << "\n";
+  cout << "   --binaryheader  Dump binary header data\n";
+  cout << "   --binaryviews   Dump binary view data\n";
+  cout << "   --startview n   Beginning view number to display (default=0)\n";
+  cout << "   --endview n     Ending view number to display (default=last view)\n";
+  cout << "   --dump          Print all scan data ASCII format\n";
+  cout << "   --version       Print version" << endl;
+  cout << "   --help          Print this help message" << endl;
 }
 
          
 
 int 
 }
 
          
 
 int 
-pjfinfo_main (const int argc, char *const argv[])
+pjinfo_main (const int argc, char *const argv[])
 {
   string pj_name;
   bool optDump = false;
 {
   string pj_name;
   bool optDump = false;
+  bool optBinaryHeader = false;
+  bool optBinaryViews = false;
+  int optStartView = 0;
+  int optEndView = -1;  // tells copyViewData to use default last view
   extern int optind;
   extern int optind;
-  Timer timerProgram;
 
   while (1)
     {
 
   while (1)
     {
+      char *endptr, *endstr;
       int c = getopt_long (argc, argv, "", my_options, NULL);
       if (c == -1)
        break;
       int c = getopt_long (argc, argv, "", my_options, NULL);
       if (c == -1)
        break;
@@ -80,6 +92,30 @@ pjfinfo_main (const int argc, char *const argv[])
        case O_DUMP:
          optDump = true;
          break;
        case O_DUMP:
          optDump = true;
          break;
+        case O_BINARYHEADER:
+           optBinaryHeader = true;
+           break;
+        case O_BINARYVIEWS:
+           optBinaryViews = true;
+           break;
+       case O_STARTVIEW:
+         optStartView = strtol(optarg, &endptr, 10);
+         endstr = optarg + strlen(optarg);
+         if (endptr != endstr) {
+           cerr << "Error setting --startview to %s" << optarg << endl;
+           pjinfo_usage(argv[0]);
+           return (1);
+         }
+         break;
+       case O_ENDVIEW:
+         optEndView = strtol(optarg, &endptr, 10);
+         endstr = optarg + strlen(optarg);
+         if (endptr != endstr) {
+           cerr << "Error setting --endview to %s" << optarg << endl;
+           pjinfo_usage(argv[0]);
+           return (1);
+         }
+         break;
         case O_VERSION:
 #ifdef VERSION
          cout << "Version " << VERSION << endl << g_szIdStr << endl;
         case O_VERSION:
 #ifdef VERSION
          cout << "Version " << VERSION << endl << g_szIdStr << endl;
@@ -89,33 +125,39 @@ pjfinfo_main (const int argc, char *const argv[])
          return (0);
        case O_HELP:
        case '?':
          return (0);
        case O_HELP:
        case '?':
-         pjfinfo_usage(argv[0]);
+         pjinfo_usage(argv[0]);
          return (0);
        default:
          return (0);
        default:
-         pjfinfo_usage(argv[0]);
+         pjinfo_usage(argv[0]);
          return (1);
        }
     }
   
   if (argc - optind != 1) {
          return (1);
        }
     }
   
   if (argc - optind != 1) {
-    pjfinfo_usage(argv[0]);
+    pjinfo_usage(argv[0]);
     return (1);
   }
 
   pj_name = argv[optind];
 
     return (1);
   }
 
   pj_name = argv[optind];
 
-  Projections pj;
-  if (! pj.read (pj_name)) {
-    sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str());
-    return (1);
-  }
-
-  if (optDump)
-    pj.printProjectionData();
+  if (optBinaryHeader)
+    Projections::copyHeader (pj_name, cout);
+  else if (optBinaryViews)
+    Projections::copyViewData (pj_name, cout, optStartView, optEndView);
   else {
   else {
-    ostringstream os;
-    pj.printScanInfo (os);
-    cout << os.str();
+    Projections pj;
+    if (! pj.read (pj_name)) {
+      sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str());
+      return (1);
+    }
+
+    if (optDump) {
+      pj.printProjectionData (optStartView, optEndView);
+    } else {
+      ostringstream os;
+      pj.printScanInfo (os);
+      cout << os.str();
+    }
   }
   
   return(0);
   }
   
   return(0);
@@ -129,7 +171,7 @@ main (const int argc, char *const argv[])
   int retval = 1;
 
   try {
   int retval = 1;
 
   try {
-    retval = pjfinfo_main(argc, argv);
+    retval = pjinfo_main(argc, argv);
   } catch (exception e) {
     cerr << "Exception: " << e.what() << endl;
   } catch (...) {
   } catch (exception e) {
     cerr << "Exception: " << e.what() << endl;
   } catch (...) {