21 #include <tjutils/tjvallist.h>
23 #include <odinpara/protocol.h>
32 #define MAX_NUMOF_READOUT_SHAPES 10
33 #define MAX_NUMOF_KSPACE_TRAJS 10
34 #define MAX_NUMOF_ADC_WEIGHTING_VECTORS 10
36 #define PROTOCOL_BLOCK_LABEL "Protocol"
45 recoLastInChunkBit =1,
47 recoEpiNavPolarityBit =4,
74 enum recoDim { userdef=0, te, dti, average, cycle, slice, line3d, line, echo, epi, templtype, navigator, freq, channel, readout, repetition, n_recoDims};
75 static const char* recoDimLabel[]={
"userdef",
"te",
"dti",
"average",
"cycle",
"slice",
"line3d",
"line",
"echo",
"epi",
"templtype",
"navigator",
"freq",
"channel",
"readout",
"repetition"};
76 AVOID_CC_WARNING(recoDimLabel)
77 static const int n_recoIndexDims=templtype+1;
91 enum templateType {no_template=0, phasecorr_template, fieldmap_template, grappa_template, n_templateTypes};
92 static const char templateTypeChar[]={
'N',
'P',
'F',
'G'};
104 static const char navigatorTypeChar[]={
'n',
'e'};
123 static int string2index(
const STD_string& str,
recoDim dim);
124 static STD_string index2string(
int index,
recoDim dim,
int numof=0);
126 STD_string printcoord(
const unsigned short* numof_cache)
const;
128 bool parsecoord(
const STD_string& str);
129 void reset2defaults();
131 static STD_string print_header(
const unsigned short* numof_cache);
134 mutable unsigned int number;
136 unsigned short adcSize;
137 unsigned char channels;
138 unsigned short preDiscard;
139 unsigned short postDiscard;
140 unsigned short concat;
149 unsigned short index[n_recoIndexDims];
158 static void assign_parsepos(
const STD_string& header);
161 static int parsepos_number;
162 static int parsepos_reps;
163 static int parsepos_adcSize;
164 static int parsepos_channels;
165 static int parsepos_preDiscard;
166 static int parsepos_postDiscard;
167 static int parsepos_concat;
168 static int parsepos_oversampling;
169 static int parsepos_relcenter;
170 static int parsepos_readoutIndex;
171 static int parsepos_trajIndex;
172 static int parsepos_weightIndex;
173 static int parsepos_dtIndex;
174 static int parsepos_index[n_recoIndexDims];
175 static int parsepos_lastinchunk;
176 static int parsepos_reflect;
177 static int max_parsepos;
190 enum LDRkSpaceCoords_state {coords_in_list, has_vec_cache, has_vec_alloc};
196 unsigned int size()
const {create_vec_cache();
return vec_cache.size();}
198 const kSpaceCoord& operator [] (
unsigned int i)
const {create_vec_cache();
return *(vec_cache[i]);}
207 void create_vec_cache()
const;
213 STD_string
get_typeInfo(
bool parx_equivtype=
false)
const {
return "kSpaceCoords";}
216 mutable STD_list<kSpaceCoord> coordlist;
218 mutable LDRkSpaceCoords_state state;
219 mutable STD_vector<kSpaceCoord*> vec_cache;
220 mutable unsigned short numof_cache[n_recoIndexDims];
230 RecoValList(
const STD_string& object_label=
"unnamedRecoValList",
unsigned int repetitions=1) :
ValList<int>(object_label,repetitions) {}
242 LDRrecoValList(
const STD_string& ldrlabel=
"unnamedLDRrecoValList");
252 STD_string
get_typeInfo(
bool parx_equivtype=
false)
const {
return "RecoValList";}
272 RecoPars(
const STD_string& label=
"unnamedRecoPars");
465 friend class SeqEpiDriverParavision;
471 void create_cache()
const;
473 void append_all_members();
485 LDRfloatArr ReadoutShape[MAX_NUMOF_READOUT_SHAPES];
488 LDRcomplexArr AdcWeightVector[MAX_NUMOF_ADC_WEIGHTING_VECTORS];
498 mutable STD_vector<int> kSpaceOrdering_cache;
499 mutable bool cache_is_up2date;
552 void append_all_members();
unsigned int get_numof_channels() const
CoilSensitivity & set_sensitivity_map(const carray &sens_map, float FOVx, float FOVy, float FOVz)
CoilSensitivity(const CoilSensitivity &cs)
CoilSensitivity & operator=(const CoilSensitivity &cs)
CoilSensitivity(const STD_string &label="unnamedCoilSensitivity")
STD_complex get_sensitivity_value(unsigned int channel, float x, float y, float z) const
STD_string printvalstring(const LDRserBase *ser=0) const
STD_ostream & print2stream(STD_ostream &os, const LDRserBase &serializer) const
LDRbase * create_copy() const
STD_string get_typeInfo(bool parx_equivtype=false) const
bool parsevalstring(const STD_string &, const LDRserBase *ser=0)
STD_string get_typeInfo(bool parx_equivtype=false) const
LDRbase * create_copy() const
bool parsevalstring(const STD_string &parstring, const LDRserBase *ser=0)
STD_ostream & print2stream(STD_ostream &os, const LDRserBase &serializer) const
STD_string printvalstring(const LDRserBase *ser=0) const
const cvector & get_AdcWeightVector(unsigned int i) const
STD_string get_PreProc3D() const
int get_NumOfAdcChunks() const
RecoPars & set_DimValues(recoDim dim, const dvector &vals)
unsigned int numof_adcs() const
fvector get_ChannelScales() const
const farray & get_kSpaceTraj(unsigned int i) const
const dvector & get_DimValues(recoDim dim) const
const fvector & get_RelativeOffset() const
int append_readout_shape(const fvector &shape, unsigned int dstsize)
int append_kspace_traj(const farray &kspace_traj)
STD_string get_CmdLineOpts() const
RecoPars & operator=(const RecoPars &sr)
RecoPars & set_CmdLineOpts(const STD_string &opts)
RecoPars(const RecoPars &sr)
int append_dwell_time(double dt)
STD_string get_Recipe() const
bool is_LittleEndian() const
const Protocol & get_protocol() const
STD_string get_PostProc3D() const
int append_adc_weight_vec(const cvector &weightvec)
const STD_string & get_ImageProc() const
RecoPars & set_Recipe(const STD_string &recipe)
LONGEST_INT get_TotalNumOfSamples(bool discard=false) const
RecoPars(const STD_string &label="unnamedRecoPars")
const LDRkSpaceCoords & get_kSpaceCoords() const
double get_DwellTime(unsigned int i) const
unsigned int get_RawHeaderSize() const
const kSpaceCoord & get_kSpaceCoord(unsigned int i) const
void get_ReadoutShape(unsigned int i, fvector &shape, unsigned int &dstsize) const
const STD_string & get_RawFile() const
RecoPars & set_PreProc3D(const STD_string &recipe)
const STD_string & get_DataFormat() const
RecoPars & set_PostProc3D(const STD_string &recipe)
unsigned int numof_kSpaceTraj() const
Base class for methods (sequences)
unsigned int size() const
const ndim & get_extent() const