00001 /*************************************************************************** 00002 image.h - description 00003 ------------------- 00004 begin : Fr Feb 25 2005 00005 copyright : (C) 2001 by Thies Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef IMAGE_H 00019 #define IMAGE_H 00020 00021 00022 #include <odinpara/protocol.h> 00023 //#include <odindata/data.h> 00024 00025 class Sample; // forward declaration 00026 00032 00033 00037 class Image : public JcampDxBlock { 00038 00039 public: 00040 00044 Image(const STD_string& label="unnamedImage"); 00045 00049 Image(const Image& i) {Image::operator = (i);} 00050 00054 Image& operator = (const Image& i); 00055 00059 Image& set_magnitude(const farray& magn) {magnitude=magn; return *this;} 00060 00064 Image& normalize_magnitude() {magnitude.normalize(); return *this;} 00065 00069 const farray& get_magnitude() const {return magnitude;} 00070 00074 unsigned int size(axis ax) const; 00075 00079 Image& set_geometry(const Geometry& g) {geo=g; return *this;} 00080 00084 const Geometry& get_geometry() const {return geo;} 00085 00090 Image& transpose_inplane(bool reverse_read=false, bool reverse_phase=false); 00091 00092 // dummy comparison operator for lists 00093 bool operator < (const Image& img) const {return STD_string(get_label())<STD_string(img.get_label());} 00094 00095 private: 00096 00097 void append_all_members(); 00098 00099 Geometry geo; 00100 JDXfloatArr magnitude; 00101 00102 }; 00103 00105 00109 class ImageSet : public JcampDxBlock { 00110 00111 public: 00112 00116 ImageSet(const STD_string& label="unnamedImageSet"); 00117 00121 ImageSet(const Image& is) {ImageSet::operator = (is);} 00122 00126 ImageSet(const Sample& smp); 00127 00131 ImageSet& operator = (const ImageSet& is); 00132 00133 00137 ImageSet& append_image(const Image& img); 00138 00139 00143 ImageSet& clear_images(); 00144 00145 00149 int get_numof_images() const {return Content.length();} 00150 00154 Image& get_image(unsigned int index=0); 00155 00156 00157 // overloading virtual functions of JcampDxBlock 00158 int load(const STD_string& filename); 00159 00160 00161 private: 00162 00163 void append_all_members(); 00164 00165 JDXstringArr Content; 00166 STD_list<Image> images; 00167 00168 Image dummy; 00169 }; 00170 00174 #endif 00175
1.5.6