r83: Converted to IF data files and C++
[ctsim.git] / src / if-1.cpp
index 16e3b82ce46daac6dbf87f30d05a5769e4a89cab..8d2330c9cec89809f46752dc3cfe69fb973104d5 100644 (file)
@@ -2,8 +2,14 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if-1.cpp,v 1.1 2000/06/07 02:29:05 kevin Exp $
+**  $Id: if-1.cpp,v 1.3 2000/06/07 07:43:19 kevin Exp $
 **  $Log: if-1.cpp,v $
+**  Revision 1.3  2000/06/07 07:43:19  kevin
+**  Converted to IF data files and C++
+**
+**  Revision 1.2  2000/06/07 03:50:27  kevin
+**  *** empty log message ***
+**
 **  Revision 1.1  2000/06/07 02:29:05  kevin
 **  Initial C++ versions
 **
@@ -153,13 +159,13 @@ if1_main (int argc, char *const argv[])
 
     im_in = new ImageFile (in_file);
     im_in->adf.fileRead ();
-    int nx = im_in->adf.nx;
-    int ny = im_in->adf.ny;
+    int nx = im_in->nx();
+    int ny = im_in->ny();
     im_out = new ImageFile (out_file, nx, ny);
     im_out->adf.fileCreate ();
 
-    ImageFileArray vIn = im_in->adf.getArray();
-    ImageFileArray vOut = im_out->adf.getArray();
+    ImageFileArray vIn = im_in->getArray();
+    ImageFileArray vOut = im_out->getArray();
 
     if (opt_invert) {
       for (ix = 0; ix < nx; ix++)
@@ -193,11 +199,7 @@ if1_main (int argc, char *const argv[])
     }
 
     im_out->adf.arrayDataWrite ();
-    for (int i = 0; i < im_in->adf.getNumLabels(); i++) {
-      Array2dFileLabel l;
-      im_in->adf.labelRead (l, i);
-      im_out->adf.labelAdd (l);
-    }
+    im_out->adf.labelsCopy (im_in->adf);
     im_out->adf.labelAdd (Array2dFileLabel::L_HISTORY, histString.c_str());
     im_out->adf.fileClose ();
   }