image.h
1 /***************************************************************************
2  image.h - description
3  -------------------
4  begin : Fr Feb 25 2005
5  copyright : (C) 2000-2015 by Thies Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef IMAGE_H
19 #define IMAGE_H
20 
21 
22 #include <odinpara/protocol.h>
23 
24 
25 class Sample; // forward declaration
26 
32 
37 class Image : public LDRblock {
38 
39  public:
40 
44  Image(const STD_string& label="unnamedImage");
45 
49  Image(const Image& i) {Image::operator = (i);}
50 
54  Image& operator = (const Image& i);
55 
59  Image& set_magnitude(const farray& magn) {magnitude=magn; return *this;}
60 
64  Image& normalize_magnitude() {magnitude.normalize(); return *this;}
65 
69  const farray& get_magnitude() const {return magnitude;}
70 
74  unsigned int size(axis ax) const;
75 
79  Image& set_geometry(const Geometry& g) {geo=g; return *this;}
80 
84  const Geometry& get_geometry() const {return geo;}
85 
90  Image& transpose_inplane(bool reverse_read=false, bool reverse_phase=false);
91 
92  // dummy comparison operator for lists
93  bool operator < (const Image& img) const {return STD_string(get_label())<STD_string(img.get_label());}
94 
95  private:
96 
97  void append_all_members();
98 
99  Geometry geo;
100  LDRfloatArr magnitude;
101 
102 };
103 
105 
109 class ImageSet : public LDRblock {
110 
111  public:
112 
116  ImageSet(const STD_string& label="unnamedImageSet");
117 
122 
126  ImageSet(const Sample& smp);
127 
131  ImageSet& operator = (const ImageSet& is);
132 
133 
137  ImageSet& append_image(const Image& img);
138 
139 
143  ImageSet& clear_images();
144 
145 
149  int get_numof_images() const {return Content.length();}
150 
154  Image& get_image(unsigned int index=0);
155 
156 
157  // overloading virtual functions of LDRblock
158  int load(const STD_string& filename, const LDRserBase& serializer=LDRserJDX());
159 
160 
161  private:
162 
163  void append_all_members();
164 
165  LDRstringArr Content;
166  STD_list<Image> images;
167 
168  Image dummy;
169 };
170 
174 #endif
175 
int get_numof_images() const
Definition: image.h:149
Image & transpose_inplane(bool reverse_read=false, bool reverse_phase=false)
ImageSet(const Image &is)
Definition: image.h:121
Image & normalize_magnitude()
Definition: image.h:64
Geometry Settings.
Definition: geometry.h:179
int load(const STD_string &filename, const LDRserBase &serializer=LDRserJDX())
axis
Definition: odinpara.h:48
Image & set_geometry(const Geometry &g)
Definition: image.h:79
const Geometry & get_geometry() const
Definition: image.h:84
Image & set_magnitude(const farray &magn)
Definition: image.h:59
const STD_string & get_label() const
Definition: tjlabel.h:48
const farray & get_magnitude() const
Definition: image.h:69
Image(const Image &i)
Definition: image.h:49
T normalize()
Image & operator=(const Image &i)
Definition: image.h:37
unsigned int size() const
Definition: tjlist.h:145
Image(const STD_string &label="unnamedImage")
ImageSet & operator=(const ImageSet &is)
Virtual Sample for Simulation.
Definition: sample.h:55