reader_odin.h
1 /***************************************************************************
2  reader_odin.h - description
3  -------------------
4  begin : Thu Oct 18 2007
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 RECOREADERODIN_H
19 #define RECOREADERODIN_H
20 
21 #include "reader.h"
22 
23 
34 class RecoReaderOdin : public virtual RecoReaderInterface {
35 
36  public:
37  RecoReaderOdin(LDRblock& parblock);
38  ~RecoReaderOdin();
39 
40  private:
41 
42  // Implementing virtual functions of RecoReaderInterface
43  bool init(const STD_string& input_filename);
44  bool fetch(RecoCoord& coord, ComplexData<1>& adc);
45  const STD_vector<RecoCoord>& get_coords() const;
46  dvector dim_values(recoDim dim) const {return recoInfo.get_DimValues(dim);}
47  const TinyVector<float,3>& reloffset() const {return reloffset_cache;}
48  STD_string image_proc() const {return image_proc_cache;}
49  const TinyVector<int,3>& image_size() const {return size_cache;}
50  const Protocol& protocol() const {return prot_cache;}
51  STD_string seqrecipe() const {return recoInfo.get_Recipe();}
52  STD_string postProc3D() const {return recoInfo.get_PostProc3D();}
53  STD_string preProc3D() const {return recoInfo.get_PreProc3D();}
54  STD_string cmdline_opts() const {return recoInfo.get_CmdLineOpts();}
55 
56 
57  void kcoord2coord(const kSpaceCoord& kcoord, RecoCoord& coord) const;
58 
59  static bool concat_data(STD_string& rawfile, const STD_string& scandir, const STD_string& fnameprefix);
60 
61  template<typename T2> bool read_block(T2 dummy, ComplexData<2>& block);
62 
63  LDRstring fifoFile;
64  LDRbool padZero;
65 
66  // read only in fetch()
67  unsigned int nadc;
68  int zeroesPerChunk;
69  unsigned int rawtypesize;
70 
71  // cached values
72  unsigned int nChannels_cache;
73  TinyVector<float,3> reloffset_cache;
74  STD_string image_proc_cache;
75  TinyVector<int,3> size_cache;
76  Protocol prot_cache;
77  ReadoutShape readoutShape_cache[MAX_NUMOF_READOUT_SHAPES];
78  KspaceTraj kspaceTraj_cache[MAX_NUMOF_KSPACE_TRAJS];
79  ComplexData<1> weightVec_cache[MAX_NUMOF_ADC_WEIGHTING_VECTORS];
80  Data<float,1> channelFactors;
81 
82 
83  // data used during reco
84  RecoPars recoInfo;
85  STD_string dataformat;
86  ComplexData<2> rawdata; // cache rawdata because all channels are loaded at once
87  STD_string rawdata_filename;
88  FILE* rawdata_fileptr;
89 // LONGEST_INT rawdata_bytecount; // for debugging
90  unsigned int index; // counter for indexing ADCs (each channel increments this counter)
91  unsigned int ri_index; // index for ADCs in recoInfo
92  kSpaceCoord kcoord_cache; // cache num of channels and crop size of current ADC
93  unsigned int chancount; // counter for channels
94 
95  mutable STD_vector<RecoCoord> coord_vec_cache;
96 
97 };
98 
99 
100 
105 #endif
106 
Definition: reco.h:265
STD_string get_Recipe() const
Definition: reco.h:423
STD_string get_PreProc3D() const
Definition: reco.h:449
STD_string get_CmdLineOpts() const
Definition: reco.h:460
STD_string get_PostProc3D() const
Definition: reco.h:437
Protcol proxy.
Definition: protocol.h:33
recoDim
Definition: reco.h:74
const dvector & get_DimValues(recoDim dim) const
Definition: reco.h:327