class Array2dFileLabel
{
-private:
- void init (void);
- Array2dFileLabel (const Array2dFileLabel&);
- Array2dFileLabel& operator= (const Array2dFileLabel&);
-
public:
kfloat64 m_calcTime;
kuint16 m_labelType;
{ m_strLabel = str; return (m_strLabel); }
const string& getDateString () const;
+
+private:
+ void init (void);
+ Array2dFileLabel (const Array2dFileLabel&);
+ Array2dFileLabel& operator= (const Array2dFileLabel&);
};
{
private:
void init (void);
- kuint16 signature;
- kuint16 num_labels;
- kuint16 headersize;
- string filename;
- int file_id;
- frnetorderstream *m_pFS;
- bool bHeaderWritten;
- bool bDataWritten;
bool headerWrite (void);
bool labelSeek (unsigned int label_num);
+ Array2dFile (const Array2dFile& rhs); // copy constructor
+ Array2dFile& operator= (const Array2dFile&); // assignment operator
+
+ protected:
+ kuint16 signature;
+ kuint16 num_labels;
+ kuint16 headersize;
+ string filename;
+ int file_id;
+ frnetorderstream *m_pFS;
+ bool bHeaderWritten;
+ bool bDataWritten;
+
kuint16 mPixelSize;
kuint16 axis_increment_known;
kfloat64 mIncX, mIncY;
kuint32 mNX;
kuint32 mNY;
- Array2dFile (const Array2dFile&);
- Array2dFile& operator= (const Array2dFile&);
public:
void doPixelOffsetScale (double offset, double scale);
+ void printLabels (ostream& os);
+
T** getArray (void) const
{ return (array.getArray()); }
}
}
+template<class T>
+void
+Array2dFile<T>::printLabels (ostream& os)
+{
+ int nlabels = getNumLabels();
+
+ for (int i = 0; i < nlabels; i++) {
+ Array2dFileLabel label;
+ labelRead (label, i);
+
+ if (label.getLabelType() == Array2dFileLabel::L_HISTORY) {
+ os << "History: " << endl;
+ os << " " << label.getLabelString() << endl;
+ os << " calc time = " << label.getCalcTime() << " secs" << endl;
+ os << " Timestamp = " << label.getDateString() << endl;
+ } else if (label.getLabelType() == Array2dFileLabel::L_USER) {
+ os << "Note: " << label.getLabelString() << endl;
+ os << " Timestamp = %s" << label.getDateString() << endl;
+ }
+ os << endl;
+ }
+}
#ifdef HAVE_MPI
#include <mpi++.h>
MPI::Datatype getMPIDataType (void) const
{ return MPI::FLOAT; }
#endif
+
+ private:
+ F32Image (const F32Image& rhs); //copy constructor
+ F32Image& operator= (const F32Image& rhs); // assignment operator
};
MPI::Datatype getMPIDataType (void) const
{ return MPI::DOUBLE; }
#endif
+ private:
+ F64Image (const F64Image& rhs); //copy constructor
+ F64Image& operator= (const F64Image& rhs); // assignment operator
};
#undef IMAGEFILE_64_BITS
#ifdef IMAGEFILE_64_BITS
-typedef F64Image ImageFile;
+typedef F64Image ImageFileBase;
typedef kfloat64 ImageFileValue;
typedef kfloat64* ImageFileColumn;
typedef kfloat64** ImageFileArray;
#else
-typedef F32Image ImageFile;
+typedef F32Image ImageFileBase;
typedef kfloat32 ImageFileValue;
typedef kfloat32* ImageFileColumn;
typedef kfloat32** ImageFileArray;
#endif
-// imagefile.cpp
-void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, double filt_param, const int opt_trace);
-int image_display (const ImageFile& im);
-int image_display_scale (const ImageFile& im, const int scale, const double pmin, const double pmax);
+class ImageFile : public ImageFileBase
+{
+ public:
+ ImageFile (const char* const fname, unsigned int nx, unsigned int ny)
+ : ImageFileBase (fname, nx, ny)
+ {}
+
+ ImageFile (unsigned int nx, unsigned int ny)
+ : ImageFileBase (nx, ny)
+ {}
+
+ ImageFile (const char* const fname)
+ : ImageFileBase (fname)
+ {}
+
+ void filterResponse (const char* const domainName, double bw, const char* const filterName, double filt_param);
+
+ void statistics (double& min, double& max, double& mean, double& mode, double& median, double& stddev) const;
+
+ void printStatistics (ostream& os) const;
+
+ bool comparativeStatistics (const ImageFile& imComp, double& d, double& r, double& e) const;
+
+ bool printComparativeStatistics (const ImageFile& imComp, ostream& os) const;
+
+ int display (void);
+
+ int displayScaling (const int scaleFactor, ImageFileValue pmin, ImageFileValue pmax);
+
+};
#endif