r91: Made ImageFile inherit from Array2dFile
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 9 Jun 2000 11:03:08 +0000 (11:03 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 9 Jun 2000 11:03:08 +0000 (11:03 +0000)
ChangeLog
configure.in
include/array2d.h
include/imagefile.h
src/ctrec.cpp
src/if-1.cpp
src/if-2.cpp
src/if2img.cpp
src/ifinfo.cpp
src/phm2if.cpp
src/rs2if.cpp

index 6b72c05d1a665eaccdab726fbe9171c763e2aef6..e4606bd99bd663885b6f79af894bc36f1631d3c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.6.0-b2 - 6/8/2000
+   Converted MPI data structures to C++ object
+       
 0.6.0-b1 - 6/6/2000
    First C++ conversions
    Portable IF (image file) format implemented with objects (SDF removed)
index 3a7ab6c4dc51b10c78c1715681f5139658e00af0..dcf7aee15388473dbe2d0b137ceb61c82c01a39e 100644 (file)
@@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout
 dnl CDPATH=
 
 AC_INIT(src/ctrec.cpp)
-AM_INIT_AUTOMAKE(ctsim,0.6.0-b1)
+AM_INIT_AUTOMAKE(ctsim,0.6.0-b2)
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
index 30b92d474d264b6025bc79bcaa7e7f6cda808f92..c4d42007b50bdc38a08f1fb48d46ea94649ebc7a 100644 (file)
@@ -9,8 +9,11 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2d.h,v 1.3 2000/06/09 01:35:33 kevin Exp $
+**  $Id: array2d.h,v 1.4 2000/06/09 11:03:08 kevin Exp $
 **  $Log: array2d.h,v $
+**  Revision 1.4  2000/06/09 11:03:08  kevin
+**  Made ImageFile inherit from Array2dFile
+**
 **  Revision 1.3  2000/06/09 01:35:33  kevin
 **  Convert MPI structure to C++ class
 **
 
 template<class T> 
 class Array2d {
- private:
-    unsigned int nx;
-    unsigned int ny;
-
  public:
-
-    T** array_data;
-
     Array2d (unsigned int x, unsigned int y)
+       : nx(x), ny(y), array_data(0)
        {
-           nx = x;
-           ny = y;
-           array_data = new T*[nx];
-           
-           for (unsigned int i = 0; i < nx; i++)
-               array_data[i] = new T[ny];
+           allocArray();
        }
 
+    Array2d (void)
+       : array_data(0), nx(0), ny(0)
+       {}
 
     ~Array2d ()
        {
-           for (int i = 0; i < nx; i++)
-               delete array_data[i];
-           delete array_data;
+           deleteArray();
        }
     
+    void initSetSize (unsigned int x, unsigned int y)
+       {
+           nx = x;
+           ny = y;
+           deleteArray();
+           allocArray();
+       }
+
     T** getArray (void) const
        { return array_data; }
 
     T* getColumn (unsigned int x) const
-       { return array_data[x]; }
+       { return (array_data ? array_data[x] : NULL); }
 
     T getPoint (unsigned int x, unsigned int y) const
-       { return (array_data[x][y]); }
+       { return (array_data ? array_data[x][y] : NULL); }
 
     unsigned int sizeofPixel (void) const 
        {  return sizeof(T); }
@@ -79,6 +80,33 @@ class Array2d {
 
     unsigned int sizeofArray (void) const
        { return (sizeof(T) * nx * ny); }
+
+
+ private:
+    unsigned int nx;
+    unsigned int ny;
+    T** array_data;
+
+    void allocArray (void)
+       {
+           array_data = new T*[nx];
+           
+           for (unsigned int i = 0; i < nx; i++)
+               array_data[i] = new T[ny];
+       }
+
+    void deleteArray (void)
+       {
+           if (array_data) {
+               for (int i = 0; i < nx; i++)
+                   delete array_data[i];
+               delete array_data;
+           }
+       }
+
+
+    Array2d& operator= (const Array2d& rhs);
+    Array2d (const Array2d& rhs);  // copy constructor
 };
 
 
index 19f5db07354362fba69b22bf48c313f93981af0c..7c0952c2acc568e8b96897a011637ac77074baa5 100644 (file)
@@ -90,7 +90,7 @@ private:
 
 public:
 
-  Array2d<T> *array;
+  Array2d<T> array;
 
   static const int INT8 = 1;
   static const int UINT8 = 2;
@@ -139,7 +139,7 @@ public:
   void doPixelOffsetScale (double offset, double scale);
 
   T** getArray (void) const
-      { return (array == NULL ? NULL : array->getArray()); }
+      { return (array.getArray()); }
 
   bool arrayDataWrite (void);
 
@@ -160,7 +160,7 @@ Array2dFile<T>::Array2dFile (unsigned int x, unsigned int y)
     init();
     mNX = x;
     mNY = y;
-    array = new Array2d<T> (mNX, mNY);
+    array.initSetSize(mNX, mNY);
 }
 
 template<class T>
@@ -170,7 +170,7 @@ Array2dFile<T>::Array2dFile (const char * const str, unsigned int x, unsigned in
     init();
     mNX = x;
     mNY = y;
-    array = new Array2d<T> (mNX, mNY);
+    array.initSetSize(mNX, mNY);
 }
 
 template<class T>
@@ -197,7 +197,6 @@ Array2dFile<T>::init (void)
   mMinX = mMaxX = mMinY = mMaxY = 0;
   mOffsetPV = 0;
   mScalePV = 1;
-  array = NULL;
   io = NULL;
 
 #if 0
@@ -233,7 +232,6 @@ template<class T>
 Array2dFile<T>::~Array2dFile (void)
 {
     fileClose ();
-    delete array;
 }
 
 
@@ -272,10 +270,8 @@ Array2dFile<T>::fileRead (void)
   }
 
   headerRead();
-  if (array != NULL)
-    delete array;
 
-  array = new Array2d<T> (mNX, mNY);
+  array.initSetSize(mNX, mNY);
 
   arrayDataRead();
 
@@ -306,8 +302,8 @@ template<class T>
 void 
 Array2dFile<T>::getPixelValueRange (T& pvmin, T& pvmax) const
 {
-    if (array != NULL) {
-       T** da = array->getArray();
+    T** da = array.getArray();
+    if (da) {
        pvmax = pvmin = da[0][0];
        for (int ix = 0; ix < mNX; ix++)
            for (int iy = 0; iy < mNY; iy++)
@@ -322,14 +318,14 @@ template<class T>
 void
 Array2dFile<T>::doPixelOffsetScale (double offset, double scale)
 {
-    if (adf != NULL) {
-      mOffsetPV = offset;
-      mScalePV = scale;
-
-      T** ad = adf->getArray();
-      for (unsigned int ix = 0; ix < mNX; ix++) 
-         for (unsigned int iy = 0; iy < mNY; iy++)
-             ad[ix][iy] = (ad[ix][iy] - offset) * scale;
+    T** ad = array.getArray();
+    if (ad) {
+       mOffsetPV = offset;
+       mScalePV = scale;
+
+       for (unsigned int ix = 0; ix < mNX; ix++) 
+           for (unsigned int iy = 0; iy < mNY; iy++)
+               ad[ix][iy] = (ad[ix][iy] - offset) * scale;
     }
 }
 
@@ -430,12 +426,16 @@ Array2dFile<T>::arrayDataWrite (void)
     return (false);
   }
 
+  T** da = array.getArray();
+  if (! da) 
+      return (false);
+
   lseek (file_id, headersize, SEEK_SET);
   for (unsigned int ix = 0; ix < mNX; ix++)
       for (unsigned int iy = 0; iy < mNY; iy++) {
-         T value = array->array_data[ix][iy];
+         T value = da[ix][iy];
          ConvertReverseNetworkOrder (&value, sizeof(T));
-         write (file_id, &value, mPixelSize);
+             write (file_id, &value, mPixelSize);
       }
 
   return (true);
@@ -450,13 +450,17 @@ Array2dFile<T>::arrayDataRead (void)
     return (false);
   }
 
+  T** da = array.getArray();
+  if (! da) 
+      return (false);
+
   lseek (file_id, headersize, SEEK_SET);
   T pixelBuffer;
   for (int ix = 0; ix < mNX; ix++) 
       for (unsigned int iy = 0; iy < mNY; iy++) {
          read (file_id, &pixelBuffer, mPixelSize);
          ConvertReverseNetworkOrder (&pixelBuffer, sizeof(T));
-         array->array_data[ix][iy] = pixelBuffer;
+         da[ix][iy] = pixelBuffer;
       }
 
   return (true);
@@ -471,12 +475,12 @@ Array2dFile<T>::labelSeek (unsigned int label_num)
     return (false);
   }
 
-  if (array == NULL) {    // Could not have written data if array not allocated
+  if (array.getArray() == NULL) {    // Could not have written data if array not allocated
     sys_error (ERR_WARNING, "array == NULL [labelSeek]");
     return (false);
   }
 
-  off_t pos = headersize + array->sizeofArray();
+  off_t pos = headersize + array.sizeofArray();
   if (lseek (file_id, pos, SEEK_SET) != pos) {
     sys_error (ERR_WARNING, "Can't seek to end of data array");
     return (false);
@@ -593,8 +597,8 @@ template<class T>
 void 
 Array2dFile<T>::arrayDataClear (void)
 {
-    if (array != NULL) {
-       T** v = array->getArray();
+    T** v = array.getArray();
+    if (v) {
        for (unsigned int ix = 0; ix < mNX; ix++)
            for (unsigned int iy = 0; iy < mNY; iy++)
                v[ix][iy] = 0;
@@ -602,39 +606,31 @@ Array2dFile<T>::arrayDataClear (void)
 }
 
 
-#ifdef MPI_CT
-#include <mpi.h>
+#ifdef HAVE_MPI
+#include <mpi++.h>
 #endif
 
-class F32Image
+class F32Image : public Array2dFile<kfloat32>
 {
 public:
-  Array2dFile<kfloat32> adf;
-
-  F32Image (const char* const fname, unsigned int nx, unsigned int ny) : adf (fname, nx, ny)
+  F32Image (const char* const fname, unsigned int nx, unsigned int ny)
+      : Array2dFile<kfloat32>::Array2dFile (fname, nx, ny)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT32);
+      setPixelType (FLOAT32);
   }
 
-  F32Image (unsigned int nx, unsigned int ny) : adf (nx, ny)
+  F32Image (unsigned int nx, unsigned int ny)
+      : Array2dFile<kfloat32>::Array2dFile (nx, ny)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT32);
+      setPixelType (FLOAT32);
   }
 
-  F32Image (const char* const fname) : adf (fname)
+  F32Image (const char* const fname)
+      : Array2dFile<kfloat32>::Array2dFile (fname)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT32);
+      setPixelType (FLOAT32);
   }
 
-  kfloat32** getArray(void) const
-      { return adf.getArray(); }
-
-  kuint32 nx(void) const
-      { return adf.nx(); }
-
-  kuint32 ny(void) const
-      { return adf.ny(); }
-
 #ifdef HAVE_MPI
   MPI::Datatype getMPIDataType (void) const
       { return MPI::FLOAT; }
@@ -642,45 +638,46 @@ public:
 };
 
 
-class F64Image 
+class F64Image : public Array2dFile<kfloat64>
 {
-public:
-  Array2dFile<kfloat64> adf;
-
-#ifdef HAVE_MPI
-  MPI::Datatype getMPIDataType (void) const
-      { return MPI::DOUBLE; }
-#endif
+ public:
 
-  F64Image (const char* const fname, unsigned int nx, unsigned int ny) : adf (fname, nx, ny)
+  F64Image (const char* const fname, unsigned int nx, unsigned int ny)
+      : Array2dFile<kfloat64>::Array2dFile (fname, nx, ny)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT64);
+      setPixelType (FLOAT64);
   }
 
-  F64Image (unsigned int nx, unsigned int ny) : adf (nx, ny)
+  F64Image (unsigned int nx, unsigned int ny)
+      : Array2dFile<kfloat64>::Array2dFile (nx, ny)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT64);
+      setPixelType (FLOAT64);
   }
 
-  F64Image (const char* const fname) : adf (fname)
+  F64Image (const char* const fname)
+      : Array2dFile<kfloat64>::Array2dFile (fname)
   {
-      adf.setPixelType (Array2dFile<kfloat64>::FLOAT64);
+      setPixelType (FLOAT64);
   }
 
-  kfloat64** getArray(void) const
-      { return adf.getArray(); }
-
-  kuint32 nx(void) const
-      { return adf.nx(); }
-
-  kuint32 ny(void) const
-      { return adf.ny(); }
+#ifdef HAVE_MPI
+  MPI::Datatype getMPIDataType (void) const
+      { return MPI::DOUBLE; }
+#endif
 };
 
+#define IMAGEFILE_64_BITS 1
+#ifdef IMAGEFILE_64_BITS
 typedef F64Image   ImageFile;
 typedef kfloat64   ImageFileValue;
 typedef kfloat64*  ImageFileColumn;
 typedef kfloat64** ImageFileArray;
+#else
+typedef F32Image   ImageFile;
+typedef kfloat32   ImageFileValue;
+typedef kfloat32*  ImageFileColumn;
+typedef kfloat32** ImageFileArray;
+#endif
 
 #endif
 
index 68b9ff669606260806bb0d8067519a05c24cd53a..ada1c10ce3c49c3c7a6a943f2c4c2762b0352079 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctrec.cpp,v 1.5 2000/06/09 01:35:33 kevin Exp $
+**  $Id: ctrec.cpp,v 1.6 2000/06/09 11:03:08 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
@@ -284,7 +284,7 @@ ctrec_main (int argc, char * argv[])
 
   if (mpiWorld.getRank() == 0) {
     im_global = new ImageFile (im_filename, nx, ny);
-    im_global->adf.fileCreate();
+    im_global->fileCreate();
   }
 
   im_local = new ImageFile (nx, ny);
@@ -295,7 +295,7 @@ ctrec_main (int argc, char * argv[])
     print_raysum_info(rs_global);
 
   im_global = new ImageFile (im_filename, nx, ny);
-  im_global->adf.fileCreate();
+  im_global->fileCreate();
 #endif
 
 #ifdef HAVE_MPI
@@ -317,8 +317,8 @@ ctrec_main (int argc, char * argv[])
   if (opt_verbose)
     mpi_t1 = MPI::Wtime();
 
-  int nxLocal = im_local->adf.nx();
-  int nyLocal = im_local->adf.ny();
+  int nxLocal = im_local->nx();
+  int nyLocal = im_local->ny();
   ImageFileArray vLocal = im_local->getArray();
   ImageFileArray vGlobal = NULL;
   if (mpiWorld.getRank() == 0)
@@ -353,10 +353,10 @@ ctrec_main (int argc, char * argv[])
     {
       raysum_close (rs_global);
       double calctime = time_end - time_start;
-      im_global->adf.arrayDataWrite ();
-      im_global->adf.labelAdd (Array2dFileLabel::L_HISTORY, rs_global->remark, rs_global->calctime);
-      im_global->adf.labelAdd (Array2dFileLabel::L_HISTORY, remark, calctime);
-      im_global->adf.fileClose ();
+      im_global->arrayDataWrite ();
+      im_global->labelAdd (Array2dFileLabel::L_HISTORY, rs_global->remark, rs_global->calctime);
+      im_global->labelAdd (Array2dFileLabel::L_HISTORY, remark, calctime);
+      im_global->fileClose ();
       if (opt_verbose)
        cout << "Time active = " << calctime << " sec" << endl;
     }
index bfdd9ddfd65bc9304fa0490894f7e883269773fa..e2993a5b675e5344ad2efc4a377616b89550f4b8 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if-1.cpp,v 1.4 2000/06/08 16:43:10 kevin Exp $
+**  $Id: if-1.cpp,v 1.5 2000/06/09 11:03:08 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
@@ -136,11 +136,11 @@ if1_main (int argc, char *const argv[])
     int ix, iy;
 
     im_in = new ImageFile (in_file);
-    im_in->adf.fileRead ();
+    im_in->fileRead ();
     int nx = im_in->nx();
     int ny = im_in->ny();
     im_out = new ImageFile (out_file, nx, ny);
-    im_out->adf.fileCreate ();
+    im_out->fileCreate ();
 
     ImageFileArray vIn = im_in->getArray();
     ImageFileArray vOut = im_out->getArray();
@@ -176,10 +176,10 @@ if1_main (int argc, char *const argv[])
       histString = "Sqrt transformation";
     }
 
-    im_out->adf.arrayDataWrite ();
-    im_out->adf.labelsCopy (im_in->adf);
-    im_out->adf.labelAdd (Array2dFileLabel::L_HISTORY, histString.c_str());
-    im_out->adf.fileClose ();
+    im_out->arrayDataWrite ();
+    im_out->labelsCopy (*im_in);
+    im_out->labelAdd (Array2dFileLabel::L_HISTORY, histString.c_str());
+    im_out->fileClose ();
   }
 
   return (0);
index 4368c17b7a757043c46c24bb24bc3ae3f29197bb..51fc23d97b5f08b1cf6cfec08c850af138667301 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if-2.cpp,v 1.2 2000/06/08 16:43:10 kevin Exp $
+**  $Id: if-2.cpp,v 1.3 2000/06/09 11:03:08 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
@@ -131,7 +131,7 @@ sdf2_main (int argc, char *const argv[])
   ImageFile& im_in1 = *pim_in1;
   ImageFile& im_in2 = *pim_in2;
 
-  if (! im_in1.adf.fileRead() || ! im_in2.adf.fileRead()) {
+  if (! im_in1.fileRead() || ! im_in2.fileRead()) {
       sys_error (ERR_WARNING, "Error reading an image");
       return (1);
   }
@@ -148,7 +148,7 @@ sdf2_main (int argc, char *const argv[])
 
   pim_out = new ImageFile (out_file, im_in1.nx(), im_in1.ny());
   ImageFile& im_out = *pim_out;
-  if (! im_out.adf.fileCreate()) {
+  if (! im_out.fileCreate()) {
     sys_error (ERR_WARNING, "Could not open output file %s", out_file);
     return (1);
   }
@@ -202,12 +202,12 @@ sdf2_main (int argc, char *const argv[])
     fprintf(stdout, "Average Error = %f\n", abs_error);
   }
 
-  im_out.adf.arrayDataWrite();
-  im_out.adf.labelsCopy (im_in1.adf, "if-2 file 1: ");
-  im_out.adf.labelsCopy (im_in2.adf, "if-2 file 2: ");
-  im_out.adf.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str());
+  im_out.arrayDataWrite();
+  im_out.labelsCopy (im_in1, "if-2 file 1: ");
+  im_out.labelsCopy (im_in2, "if-2 file 2: ");
+  im_out.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str());
 
-  im_out.adf.fileClose();
+  im_out.fileClose();
 
   return (0);
 }
index d25c39483f15c669c5fdd865d293a46468281d08..a99b8012e20b53dad885940c1e69fabbe35d4dcc 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if2img.cpp,v 1.2 2000/06/08 16:43:10 kevin Exp $
+**  $Id: if2img.cpp,v 1.3 2000/06/09 11:03:08 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
@@ -281,17 +281,17 @@ if2img_main (int argc, char *const argv[])
 
   pim = new ImageFile (in_file);
   ImageFile& im = *pim;
-  if (! im.adf.fileRead()) {
+  if (! im.fileRead()) {
     fprintf(stderr, "File %s does not exist\n", in_file);
     return (1);
   }
 
   if (opt_labels) {
-    int nlabels = im.adf.getNumLabels();
+    int nlabels = im.getNumLabels();
 
     for (int i = 0; i < nlabels; i++) {
       Array2dFileLabel label;
-      im.adf.labelRead (label, i);
+      im.labelRead (label, i);
       string str;
       label.getDateString (str);
 
index bc55c1ec7f464ba1fc03ea077cd7be4e95293bc2..a78a08590df816af79986423710b677515e3b4cf 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ifinfo.cpp,v 1.4 2000/06/08 16:43:10 kevin Exp $
+**  $Id: ifinfo.cpp,v 1.5 2000/06/09 11:03:08 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
@@ -127,20 +127,20 @@ ifinfo_main (int argc, char *const argv[])
   in_file = argv[optind];
 
   im = new ImageFile (in_file);
-  if (! im->adf.fileRead ()) {
+  if (! im->fileRead ()) {
     sys_error (ERR_WARNING, "Unable to read file %s", in_file);
     return (1);
   }
 
   if (opt_labels) 
     {
-      int nlabels = im->adf.getNumLabels();
+      int nlabels = im->getNumLabels();
       int i;
 
       for (i = 0; i < nlabels; i++)
        {
            Array2dFileLabel label;
-           im->adf.labelRead (label, i);
+           im->labelRead (label, i);
 
            string str;
            label.getDateString (str);
index 66ceb470c4a3af84386d79e66f9069af0d51627a..63d5a49b7a38ce2987cddd707fe0f78aab929c9f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phm2if.cpp,v 1.6 2000/06/09 01:35:33 kevin Exp $
+**  $Id: phm2if.cpp,v 1.7 2000/06/09 11:03:08 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
@@ -317,12 +317,12 @@ phm2sdf_main (int argc, char* argv[])
 
   if (mpiWorld.getRank() == 0) {
     im_global = new ImageFile (opt_outfile, opt_nx, opt_ny);
-    im_global->adf.fileCreate();
+    im_global->fileCreate();
   }
   im_local = new ImageFile (opt_nx, opt_ny);
 #else
   im_global = new ImageFile (opt_outfile, opt_nx, opt_ny);
-  im_global->adf.fileCreate ();
+  im_global->fileCreate ();
 #endif
 
   if (opt_phmnum >= 0)
@@ -395,10 +395,10 @@ phm2sdf_main (int argc, char* argv[])
   if (mpiWorld.getRank() == 0) 
 #endif
   {
-    im_global->adf.arrayDataWrite ();
+    im_global->arrayDataWrite ();
     calctime = time_end - time_start;
-    im_global->adf.labelAdd (Array2dFileLabel::L_HISTORY, opt_desc, calctime);
-    im_global->adf.fileClose ();
+    im_global->labelAdd (Array2dFileLabel::L_HISTORY, opt_desc, calctime);
+    im_global->fileClose ();
     if (opt_verbose)
       fprintf (stdout, "Time to compile image = %.2f sec\n\n", calctime);
 
index 42a8220876cb7252c5556e8a18de34847100f712..82ed201b6cc6a316d9bbaf8e23e13ef2c0999033 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: rs2if.cpp,v 1.3 2000/06/08 16:43:10 kevin Exp $
+**  $Id: rs2if.cpp,v 1.4 2000/06/09 11:03:08 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
@@ -136,11 +136,11 @@ rs2if_main (const int argc, char *const argv[])
   detarray_free (detarray);
   raysum_close (rs);
 
-  im->adf.fileCreate ();
-  im->adf.arrayDataWrite ();
-  im->adf.labelAdd (Array2dFileLabel::L_HISTORY, rs->remark, rs->calctime);
-  im->adf.labelAdd (Array2dFileLabel::L_HISTORY, "Conversion from .rs to .idf");
-  im->adf.fileClose ();
+  im->fileCreate ();
+  im->arrayDataWrite ();
+  im->labelAdd (Array2dFileLabel::L_HISTORY, rs->remark, rs->calctime);
+  im->labelAdd (Array2dFileLabel::L_HISTORY, "Conversion from .rs to .idf");
+  im->fileClose ();
   
   return(0);
 }