00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SAMPLE_H
00019 #define SAMPLE_H
00020
00021 #include <odinpara/jdxblock.h>
00022 #include <odinpara/jdxnumbers.h>
00023 #include <odinpara/jdxarrays.h>
00024 #include <odinpara/odinpara.h>
00025
00041 enum sampleDim { frameDim=0, freqDim, zDim, yDim, xDim, n_sampleDim };
00042
00043
00045
00046
00055 class Sample : public JcampDxBlock {
00056
00057 public:
00058
00064 Sample(const STD_string& label="unnamedSample", bool uniformFOV=true, bool uniformT1T2=false);
00065
00069 Sample(const Sample& ss);
00070
00074 Sample& operator = (const Sample& ss);
00075
00079 Sample& set_FOV(float fov);
00080
00084 Sample& set_FOV(axis direction, float fov);
00085
00089 float get_FOV(axis direction) const;
00090
00094 Sample& set_spatial_offset(axis direction, float offs) {offset[direction]=offs; return *this;}
00095
00099 float get_spatial_offset(axis direction) const {return offset[direction];}
00100
00104 Sample& set_freqrange(float range) {freqrange=range; return *this;}
00105
00109 float get_freqrange() const {return freqrange;}
00110
00114 Sample& set_freqoffset(float offs) {freqoffset=offs; return *this;}
00115
00119 float get_freqoffset() const {return freqoffset;}
00120
00121
00127 Sample& set_frame_durations(const dvector& intervals) {frameDurations=intervals; return *this;}
00128
00132 const dvector& get_frame_durations() const {return frameDurations;}
00133
00134
00143 Sample& resize(unsigned int framesize, unsigned int freqsize, unsigned int zsize, unsigned int ysize, unsigned int xsize);
00144
00148 const ndim& get_extent() const {return spinDensity.get_extent();}
00149
00153 Sample& set_T1(float relaxation_time) {T1=relaxation_time; haveT1map=false; return *this;}
00154
00158 Sample& set_T2(float relaxation_time) {T2=relaxation_time; haveT2map=false; return *this;}
00159
00163 Sample& set_T1map(const farray& t1map);
00164
00168 const farray& get_T1map() const;
00169
00173 Sample& set_T2map(const farray& t2map);
00174
00178 const farray& get_T2map() const;
00179
00183 Sample& set_ppmMap(const farray& ppmmap);
00184
00188 const farray& get_ppmMap() const;
00189
00193 Sample& set_spinDensity(const farray& sd);
00194
00198 const farray& get_spinDensity() const;
00199
00203 Sample& set_DcoeffMap(const farray& dmap);
00204
00208 const farray& get_DcoeffMap() const;
00209
00213 Sample& update();
00214
00215
00216
00217 int load(const STD_string& filename);
00218
00219
00220 private:
00221 friend class SeqSimMagsi;
00222
00223 int append_all_members();
00224
00225 bool check_and_correct(const char* mapname, const farray& srcmap, farray& dstmap);
00226
00227
00228 JDXfloat FOVall;
00229 JDXtriple FOV;
00230 bool uniFOV;
00231 JDXtriple offset;
00232
00233 JDXfloat freqrange;
00234 JDXfloat freqoffset;
00235
00236 JDXdoubleArr frameDurations;
00237
00238 mutable JDXfloatArr spinDensity;
00239
00240 bool uniT1T2;
00241 JDXfloat T1;
00242 JDXfloat T2;
00243 mutable JDXfloatArr T1map;
00244 mutable JDXfloatArr T2map;
00245 mutable bool haveT1map;
00246 mutable bool haveT2map;
00247
00248 mutable JDXfloatArr ppmMap;
00249 mutable bool have_ppmMap;
00250
00251 mutable JDXfloatArr DcoeffMap;
00252 mutable bool have_DcoeffMap;
00253
00254 };
00255
00256
00260 #endif