ODIN
store.h
1 /***************************************************************************
2  store.h - description
3  -------------------
4  begin : Sat Dec 30 2006
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 RECOSTORE_H
19 #define RECOSTORE_H
20 
21 #include "step.h"
22 
23 #include <odindata/fileio.h>
24 #include <odindata/filter.h>
25 
26 class RecoStore : public RecoStep {
27 
28  public:
29 
30  static STD_string default_format();
31 
32 
33  private:
34 
35  // implementing virtual functions of RecoStep
36  STD_string label() const {return "store";}
37  STD_string description() const {return "Store reconstructed images";}
38  bool process(RecoData& rd, RecoController& controller);
39  RecoCoord input_coord() const {return RecoCoord::coord_with_mode(RecoIndex::collected,repetition,slice,line3d,line,readout);}
40  void modify_coord(RecoCoord& coord) const {}
41  bool query(RecoQueryContext& context);
42  RecoStep* allocate() const {return new RecoStore;}
43  void init();
44 
45  LDRstring extension;
46  LDRstring prefix;
47  LDRstring formats;
48  LDRstring imageproc;
49  LDRbool storephase;
50  FileWriteOpts wopts; // for access to some autowrite opts
51 
52  bool store_images(const RecoController& controller);
53 
54  FileIO::ProtocolDataMap pdmap; // Will hold image data with protocol as key
55  Mutex mutex;
56 
57  FilterChain filterchain;
58 
59 };
60 
62 
63 
64 class RecoReal : public RecoStep {
65 
66  // implementing virtual functions of RecoStep
67  STD_string label() const {return "real";}
68  STD_string description() const {return "Throw away imaginary part of data and keep only real part";}
69  bool process(RecoData& rd, RecoController& controller);
70  RecoCoord input_coord() const {return RecoCoord::any();}
71  void modify_coord(RecoCoord& coord) const {}
72  RecoStep* allocate() const {return new RecoReal;}
73  void init() {}
74 
75 };
76 
77 class RecoMagn : public RecoStep {
78 
79  // implementing virtual functions of RecoStep
80  STD_string label() const {return "magn";}
81  STD_string description() const {return "Only take magnitude and set phase to zero";}
82  bool process(RecoData& rd, RecoController& controller);
83  RecoCoord input_coord() const {return RecoCoord::coord_with_mode(RecoIndex::collected,line3d,line,readout);}
84  void modify_coord(RecoCoord& coord) const {}
85  RecoStep* allocate() const {return new RecoMagn;}
86  void init() {}
87 
88 };
89 
90 
91 #endif
92 
STD_map< Protocol, Data< float, 4 > > ProtocolDataMap
Definition: fileio.h:89
Definition: tjthread.h:46
magn: Only take magnitude and set phase to zero
Definition: store.h:77
real: Throw away imaginary part of data and keep only real part
Definition: store.h:64
store: Store reconstructed images
Definition: store.h:26
static RecoCoord coord_with_mode(RecoIndex::indexMode m, recoDim d1=n_recoDims, recoDim d2=n_recoDims, recoDim d3=n_recoDims, recoDim d4=n_recoDims, recoDim d5=n_recoDims, recoDim d6=n_recoDims, recoDim d7=n_recoDims, recoDim d8=n_recoDims)
Definition: index.h:254
static RecoCoord any()
Definition: index.h:219