JEMRIS  2.8.1
open-source MRI simulations
CoilArray.h
Go to the documentation of this file.
1 
5 /*
6  * JEMRIS Copyright (C)
7  * 2006-2015 Tony Stoecker
8  * 2007-2015 Kaveh Vahedipour
9  * 2009-2015 Daniel Pflugfelder
10  *
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 #ifndef COILARRAY_H_
28 #define COILARRAY_H_
29 
30 #include "XMLIO.h"
31 
32 #include "Signal.h"
33 #include "CoilPrototypeFactory.h"
34 
35 class Coil;
36 
40 class CoilArray {
41 
42  public:
43 
49  CoilArray();
50 
56  void Initialize (string uri);
57 
62  unsigned int Populate ();
63 
67  virtual ~CoilArray ();
68 
77  static unsigned int CreateCoil (void* ptr,DOMNode* node);
78 
85  DOMNode* RunTree (DOMNode* node, void* ptr, unsigned int (*fun) (void*, DOMNode*));
86 
87 
93  inline unsigned int GetSize () { return m_coils.size(); };
94 
100  void InitializeSignals (long lADCs);
101 
107  void Receive (long lADC);
108 
113  IO::Status DumpSignals (string tmp_prefix = "", bool normalize = true);
114 
119  IO::Status DumpSensMaps (bool verbose = false);
120 
121 
127  void SetSignalPrefix (string val) {m_signal_prefix = val;};
128 
129  string GetSignalPrefix () {return m_signal_prefix;};
130 
131  void SetSenMaplPrefix (string val) {m_senmap_prefix = val;};
132 
133  string GetSenMaplPrefix () {return m_senmap_prefix;};
134 
140  void SetSenMapOutputDir(string dir) { m_senmap_output_dir = dir; };
141 
142  string GetSenMapOutputDir () {return m_senmap_output_dir;};
143 
149  void SetSignalOutputDir(string dir) { m_signal_output_dir = dir; };
150 
151  string GetSignalOutputDir () {return m_signal_output_dir;};
152 
159  Coil* GetCoil (unsigned channel);
160 
168  bool Prepare (const PrepareMode mode);
169 
173  void setMode (unsigned short mode) { m_mode = mode; }
174 
178  int ReadRestartSignal();
179 
180  private:
181 
182  vector<Coil*> m_coils;
183  double m_radius;
184  unsigned short m_mode;
191  DOMDocument* m_dom_doc;
196 };
197 
198 #endif /*COILARRAY_H_*/
XML file-IO class.
Definition: XMLIO.h:61
XMLIO * m_xio
My XML IO module.
Definition: CoilArray.h:193
string m_senmap_output_dir
string to sensitivity map directory
Definition: CoilArray.h:188
void Receive(long lADC)
Recieve a signal from the World singleton with my coils for a given event.
Definition: CoilArray.cpp:142
DOMNode * RunTree(DOMNode *node, void *ptr, unsigned int(*fun)(void *, DOMNode *))
Run over XML tree and return nodes.
Definition: CoilArray.cpp:100
static unsigned int CreateCoil(void *ptr, DOMNode *node)
Clone a coil.
Definition: CoilArray.cpp:87
string m_signal_prefix
prefix string to signal binary filenames
Definition: CoilArray.h:185
IO::Status DumpSensMaps(bool verbose=false)
Dump all sensitivities Dump the sensitivities from all coils to discrete files.
Definition: CoilArray.cpp:221
void Initialize(string uri)
Initialize the array and its elements.
Definition: CoilArray.cpp:127
vector< Coil * > m_coils
My coils.
Definition: CoilArray.h:182
unsigned int Populate()
Populate coil array Run over coil array configuration tree and Populate the array.
Definition: CoilArray.cpp:57
This interface knows about coil prototypes.
Definition: CoilPrototypeFactory.h:36
virtual ~CoilArray()
Default destructor.
Definition: CoilArray.cpp:48
World parameters provide the parametric data of the sequence.
Definition: Parameters.h:37
unsigned short m_mode
My mode (RX/TX)
Definition: CoilArray.h:184
double m_radius
My radius.
Definition: CoilArray.h:183
int ReadRestartSignal()
reads restart signal.
Definition: CoilArray.cpp:259
Parameters * m_params
My parameters.
Definition: CoilArray.h:192
void InitializeSignals(long lADCs)
Create the signal structures of given size for all my coils.
Definition: CoilArray.cpp:134
Coil configuration and sensitivities.
Definition: CoilArray.h:40
void SetSignalOutputDir(string dir)
Set signals output directory Directory the signal binary is saved to.
Definition: CoilArray.h:149
CoilArray()
Default constructor.
Definition: CoilArray.cpp:34
Coil * GetCoil(unsigned channel)
Get a particular coil.
Definition: CoilArray.cpp:250
string m_senmap_prefix
prefix string to sensitivity map filenames
Definition: CoilArray.h:186
IO::Status DumpSignals(string tmp_prefix="", bool normalize=true)
Dump all signals Dump the signals from all coils to discrete files.
Definition: CoilArray.cpp:150
CoilPrototypeFactory * m_cpf
Coil factory.
Definition: CoilArray.h:190
mode
Definition: Declarations.h:112
Implementation of JEMRIS Signal.
string m_signal_output_dir
string to signal directory
Definition: CoilArray.h:187
bool Prepare(const PrepareMode mode)
Prepare my coils.
Definition: CoilArray.cpp:77
DOMDocument * m_dom_doc
DOM document containing configuration.
Definition: CoilArray.h:191
Implementation of JEMRIS XMLIO.
Status
Definition: Declarations.h:148
Implementation of JEMRIS CoilPrototypeFactory.
unsigned int GetSize()
Get the number of channels.
Definition: CoilArray.h:93
Base class of coil objects.
Definition: Coil.h:39
void SetSignalPrefix(string val)
Set signal file-name prefix Set the prefix string for signal binary filenames.
Definition: CoilArray.h:127
void SetSenMapOutputDir(string dir)
Set SensMap output directory Directory the SensMap is saved to.
Definition: CoilArray.h:140

-- last change 17.06.2016 | Tony Stoecker | Imprint --