sample.h

00001 /***************************************************************************
00002                           sample.h  -  description
00003                              -------------------
00004     begin                : Mon Jul 11 2005
00005     copyright            : (C) 2001 by Thies H. 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 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 
00037 enum sampleDim { freqDim=0, zDim, yDim, xDim };
00038 
00039 
00041 
00042 
00051 class Sample : public JcampDxBlock {
00052 
00053  public:
00054 
00060   Sample(const STD_string& label="unnamedSample", bool uniformFOV=true, bool uniformT1T2=false);
00061 
00065   Sample(const Sample& ss);
00066 
00070   Sample& operator = (const Sample& ss);
00071 
00075   Sample& set_FOV(float fov);
00076 
00080   Sample& set_FOV(axis direction, float fov);
00081 
00085   float get_FOV(axis direction) const;
00086 
00090   Sample& set_spatial_offset(axis direction, float offs) {offset[direction]=offs; return *this;}
00091 
00095   float get_spatial_offset(axis direction) const {return offset[direction];}
00096 
00100   Sample& set_freqrange(float range) {freqrange=range; return *this;}
00101 
00105   float get_freqrange() const {return freqrange;}
00106 
00110   Sample& set_freqoffset(float offs) {freqoffset=offs; return *this;}
00111 
00115   float get_freqoffset() const {return freqoffset;}
00116 
00117 
00118 
00126   Sample& resize(unsigned int xsize, unsigned int ysize, unsigned int zsize, unsigned int freqsize=1);
00127 
00131   const ndim& get_extent() const;
00132 
00136   Sample& set_T1(float relaxation_time) {T1=relaxation_time; haveT1map=false; return *this;}
00137 
00141   Sample& set_T2(float relaxation_time) {T2=relaxation_time; haveT2map=false; return *this;}
00142 
00146   Sample& set_T1map(const farray& t1map);
00147 
00151   const farray& get_T1map() const;
00152 
00156   Sample& set_T2map(const farray& t2map);
00157 
00161   const farray& get_T2map() const;
00162 
00166   Sample& set_ppmMap(const farray& ppmmap);
00167 
00171   const farray& get_ppmMap() const;
00172 
00176   Sample& set_spinDensity(const farray& sd);
00177 
00181   const farray& get_spinDensity() const;
00182 
00186   Sample& set_B1map(const carray& b1map);
00187 
00191   const carray& get_B1map() const;
00192 
00196   Sample& set_DcoeffMap(const farray& dmap);
00197 
00201   const farray& get_DcoeffMap() const;
00202 
00206   Sample& update();
00207 
00208 
00209   // overwriting virtual functions from JcampDxClass
00210   int load(const STD_string& filename);
00211 
00212 
00213  private:
00214   friend class SeqSimMagsi;
00215 
00216   int append_all_members();
00217 
00218   JDXfloat FOVall;
00219   JDXtriple FOV;
00220   bool uniFOV;
00221   JDXtriple offset;
00222 
00223   JDXfloat freqrange;
00224   JDXfloat freqoffset;
00225 
00226   mutable JDXfloatArr spinDensity;
00227 
00228   bool uniT1T2;
00229   JDXfloat T1;
00230   JDXfloat T2;
00231   mutable JDXfloatArr T1map;
00232   mutable JDXfloatArr T2map;
00233   mutable bool haveT1map;
00234   mutable bool haveT2map;
00235 
00236   mutable JDXfloatArr ppmMap;
00237   mutable bool have_ppmMap;
00238 
00239   mutable JDXcomplexArr B1map;
00240   mutable bool have_B1map;
00241 
00242   mutable JDXfloatArr DcoeffMap;
00243   mutable bool have_DcoeffMap;
00244 
00245 };
00246 
00247 
00251 #endif

Generated on Sat Jun 14 12:31:22 2008 by  doxygen 1.5.1