ODIN
reader_ismrmrd.h
1 /***************************************************************************
2  reader_ismrmrd.h - description
3  -------------------
4  begin : Fri Oct 2 2015
5  copyright : (C) 2000-2021 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 RECOREADERISMRMRD_H
19 #define RECOREADERISMRMRD_H
20 
21 
22 #include "reader.h"
23 
24 
25 #ifdef ISMRMRDSUPPORT
26 
27 namespace ISMRMRD {
28  class Dataset; // forward declaration
29  class AcquisitionHeader; // forward declaration
30  class Limit; // forward declaration
31 }
32 
43 class RecoReaderISMRMRD : public virtual RecoReaderInterface {
44 
45  public:
46  RecoReaderISMRMRD(LDRblock&) : dset(0) {}
47  ~RecoReaderISMRMRD();
48 
49  private:
50 
51  // Implementing virtual functions of RecoReaderInterface
52  bool init(const STD_string& input_filename);
53  bool fetch(RecoCoord& coord, ComplexData<1>& adc);
54  const STD_vector<RecoCoord>& get_coords() const {return coord_vec_cache;}
55  dvector dim_values(recoDim dim) const;
56  const TinyVector<float,3>& reloffset() const {return reloffset_cache;}
57  STD_string image_proc() const {return "";}
58  const TinyVector<int,3>& image_size() const {return size_cache;}
59  const Protocol& protocol() const {return prot_cache;}
60  STD_string seqrecipe() const {return "";} // Let controller generate recipe automatically
61  STD_string postProc3D() const {return "";}
62  STD_string preProc3D() const {return "";}
63  STD_string cmdline_opts() const;
64 
65  // Cached values
66  TinyVector<float,3> reloffset_cache;
67  TinyVector<int,3> size_cache;
68  Protocol prot_cache;
69 
70  ISMRMRD::Dataset* dset;
71 
72  mutable STD_vector<RecoCoord> coord_vec_cache; // Vector to hold reco coordinates (indices)
73  KspaceTraj kspaceTraj_cache;
74  unsigned int ismrmrd_nacq; // number of ADCs in ISMRMRD dataset
75  unsigned int ismrmrd_count; // counter for ADCs in ISMRMRD dataset
76  unsigned int coord_count; // counter for pipeline ADCs
77 
78  // data used during reco
79  unsigned int chancount; // counter for channels
80  ComplexData<2> rawdata; // cache rawdata because all channels are loaded at once
81  unsigned int pre_discard_cache;
82  unsigned int post_discard_cache;
83  unsigned int nsamples_raw_cache;
84  unsigned int nchan_cache;
85 
86  static void print_flags(ISMRMRD::AcquisitionHeader& acqhead);
87  static bool ignore_acq(ISMRMRD::AcquisitionHeader& acqhead);
88  static bool pe_offset(const ISMRMRD::Limit& limit, unsigned int& offset, float& partfour_prot);
89 };
90 
91 
92 
96 #endif // ISMRMRDSUPPORT
97 
98 #endif
99 
Protocol proxy.
Definition: protocol.h:33
virtual STD_string image_proc() const =0
virtual STD_string postProc3D() const =0
virtual const Protocol & protocol() const =0
virtual STD_string cmdline_opts() const =0
virtual bool init(const STD_string &input_filename)=0
virtual const STD_vector< RecoCoord > & get_coords() const =0
virtual const TinyVector< float, 3 > & reloffset() const =0
virtual STD_string seqrecipe() const =0
virtual const TinyVector< int, 3 > & image_size() const =0
virtual STD_string preProc3D() const =0
virtual dvector dim_values(recoDim dim) const =0
virtual bool fetch(RecoCoord &coord, ComplexData< 1 > &adc)=0
recoDim
Definition: reco.h:74