** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ifinfo.cpp,v 1.1 2000/06/07 02:29:05 kevin Exp $
+** $Id: ifinfo.cpp,v 1.3 2000/06/07 07:43:19 kevin Exp $
** $Log: ifinfo.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
**
in_file = argv[optind];
im = new ImageFile (in_file);
- im->adf.fileRead ();
+ if (! im->adf.fileRead ()) {
+ sys_error (ERR_WARNING, "Unable to read file %s", in_file);
+ return (1);
+ }
if (opt_labels)
{
for (i = 0; i < nlabels; i++)
{
Array2dFileLabel label;
- string str;
-
im->adf.labelRead (label, i);
+
+ string str;
label.getDateString (str);
if (label.getLabelType() == Array2dFileLabel::L_HISTORY) {
int ix, iy;
maxbin = nbin - 1;
- ImageFileArray v = im->adf.getArray();
- int nx = im->adf.nx;
- int ny = im->adf.ny;
+ ImageFileArray v = im->getArray();
+ int nx = im->nx();
+ int ny = im->ny();
for (ix = 0; ix < nx; ix++)
{
}
}
stddev = sqrt(stddev / (nx * ny));
- fprintf(stdout,"nx=%d\n", nx);
- fprintf(stdout,"ny=%d\n", ny);
- fprintf(stdout,"min=%f\n", minfound);
- fprintf(stdout,"max=%f\n", maxfound);
- fprintf(stdout,"mean=%f\n", mean);
- fprintf(stdout,"mode=%f\n", mode);
- fprintf(stdout,"stddev=%f\n", stddev);
+ cout << "nx=" << nx << endl;
+ cout << "nx=" << ny << endl;
+ cout << "min=" << minfound << endl;
+ cout << "max=" << maxfound << endl;
+ cout << "mean=" << mean << endl;
+ cout << "mode=" << mode << endl;
+ cout << "stddef=" << stddev << endl;
}
return (0);