This file is indexed.

/usr/include/odinpara/system.h is in libodin-dev 1.8.8-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
/***************************************************************************
                          system.h  -  description
                             -------------------
    begin                : Wed Jun 29 2005
    copyright            : (C) 2000-2014 by Thies H. Jochimsen
    email                : thies@jochimsen.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SYSTEM_H
#define SYSTEM_H

#include <tjutils/tjhandler.h>

#include <odinpara/jdxblock.h>
#include <odinpara/jdxnumbers.h>
#include <odinpara/jdxarrays.h>
#include <odinpara/odinpara.h>


// defaults for systemInfo
#define _DEFAULT_B0_                  3000 // 3 Tesla
#define _DEFAULT_MAX_SYSTEM_GRADIENT_ 0.04
#define _DEFAULT_MAX_SYSTEM_SLEWRATE_ 0.2


/**
  * @ingroup odinpara
  * This enum is used to specify the scanner system type
  */
enum odinPlatform {standalone=0, paravision, numaris_4, epic, numof_platforms};

/**
  * @ingroup odinpara
  * This enum is used to distinguish different properties of sequence objects according to
  * their category. Examples are minimum duration or rastertime.
  */
enum objCategory {unknownObj=0,delayObj,pulsObj,gradObj,loopObj,acqObj,freqObj,syncObj,endObj};

/////////////////////////////////////////////////////////////////////////

/**
  * @ingroup odinpara
  * This class is a small database which maps nuclei names to gyromagnetic ratios.
  */
class Nuclei {

 public:
  Nuclei();

/**
  * Returns the gyromagnetic ratio of the nucleus with name 'nucName'
  */
  double get_gamma(const STD_string& nucName) const;

/**
  * Returns the base frequency of the nucleus with name 'nucName' in a static field with the strength 'B0'
  */
  double get_nuc_freq(const STD_string& nucName,float B0) const;


/**
  * Returns an enum with all registered nuclei as entries
  */
  JDXenum get_nuc_enum() const;

 private:
  typedef STD_pair<STD_string, double> Nucleus;
  typedef STD_list<Nucleus> NucList; // do not use std::map since we do not want unsorted list

  NucList nuclist;
};

/////////////////////////////////////////////////////////////////////////

/**
  * @ingroup odinpara
  *
  * \brief System proxy
  *
  * This class is used to hold all information/configuration of the spectrometer
  */
class System : public JcampDxBlock {

 public:

/**
  * Constructs a System with the given label
  */
   System(const STD_string& object_label="unnamedSystem");

/**
  * Copy constructor
  */
   System(const System& s) {System::operator = (s);}

/**
  * Assignment operator
  */
  System& operator = (const System& s);

/**
  * Returns the platform identifier for the scanner, works only in the context of sequence programming
  */
  odinPlatform get_platform() const;

/**
  * Returns a string identifying the platform
  */
  STD_string get_platform_str() const {return platformstr;}

/**
  * Returns a string identifying the transmit coil
  */
  STD_string get_transmit_coil_name() const {return transmit_coil_name;}

/**
  * Sets the transmit coil name
  */
  System& set_transmit_coil_name(const STD_string& tcname);

/**
  * Returns the current main nucleus of the sequence, i.e. the nucleus for which both, excitation and acquisition, will be performed
  */
  STD_string get_main_nucleus() const {return main_nucleus;}

/**
  * Specifies the current main nucleus of the scanner, i.e. the nucleus for which both, excitation and acquisition, will be performed
  */
  System& set_main_nucleus(const STD_string& nucname);

/**
  * Returns the maximum gradient strength of the scanner
  */
  float get_max_grad() const {return max_grad;}

/**
  * Returns the maximum slew rate
  */
  float get_max_slew_rate() const {return max_slew_rate;}

/**
  * Returns the time required to change the gradient strength by the specified amount
  */
  float get_grad_switch_time(float graddiff) const;

/**
  * Returns the minimum time gap between two gradient commands
  */
  float get_inter_grad_delay() const {return inter_grad_delay;}

/**
  * Sets the directory where the experimental data files of the current scans are stored
  */
  System& set_scandir(const STD_string& dir);

/**
  * Returns the directory where the experimental data files of the current scans are stored
  */
  STD_string get_scandir() const;


/**
  * Returns the time shift between RF and gradient channel
  */
  float get_grad_shift_delay() const {return grad_shift;}

/**
  * Returns the field strength of the static magnetic field
  */
  double get_B0() const {return B0;}

/**
  * Returns the field strength of the static magnetic field
  */
  System& set_B0(double b0) {B0=b0; return *this;}

/**
  * Specifies the field strength of the static magnetic field by giving the resonance frequency
  * for the specified nucleus
  */
  System& set_B0_from_freq(double freq, const STD_string& nucName="");

/**
  * Returns the gyromagnetic ratio of the given nucleus, default returns the ratio of protons
  */
  double get_gamma(const STD_string& nucName="") const;

/**
  * Sets the reference gain in dB
  */
  System& set_reference_gain(float refgain);

/**
  * Returns the reference gain in dB
  */
  float get_reference_gain() const {return reference_gain;}

/**
  * Returns the resonance for the given nucleus
  */
  double get_nuc_freq(const STD_string& nucName="") const;


/**
  * Returns an enum with all registered nuclei as entries
  */
  JDXenum get_nuc_enum() const;

/**
  * Returns the minimum duration for the given object category
  */
  double get_min_duration(objCategory c) const {return min_duration[c];}

/**
  * Returns the minimum gradient raster time
  */
  double get_min_grad_rastertime() const {return min_grad_rastertime;}

/**
  * Returns the raster time for the given object category, if no such time exists, it returns 0
  */
  double get_rastertime(objCategory cat) const;

/**
  * Returns the rastered time for the given object type and non-rastered time point/period
  */
  double get_rasteredtime(objCategory cat, double time) const;

/**
  * Returns the maximum number of samples per RF pulse
  */
  int get_max_rf_samples() const {return  max_rf_samples;}

/**
  * Returns the maximum number of samples per gradient waveform
  */
  int get_max_grad_samples() const {return  max_grad_samples;}

/**
  * Sets the data represention type of the image data
  */
  System& set_data_type(const STD_string& type) {datatype=type;  return *this;}

/**
  * Returns the data represention type of the image data
  */
  STD_string get_data_type() const {return datatype;}


/**
  * Returns 'true' if gradient switching frequency 'freq' does not cause
  * acoustic resonance, otherwise, 'low' and 'upp' will contain the next
  * possible lower and upper frequencies, respectively.
  */
  bool allowed_grad_freq(double freq, double& low, double& upp) const;


 private:
  friend class SeqMethod;
  friend class SeqIdea;
  friend class SeqParavision;
  friend class SeqStandAlone;
  friend class SeqEpic;

  // overwriting virtual functions from JcampDxClass
  int load(const STD_string &filename);




  int append_all_members();

  Nuclei nuc;

  JDXstring platformstr;
  JDXenum   main_nucleus;
  JDXdouble max_grad;
  JDXdouble max_slew_rate;
  JDXdouble grad_shift;
  JDXdouble inter_grad_delay;
  JDXdouble B0;
  JDXdouble reference_gain;
  JDXstring transmit_coil_name;

  JDXdouble delay_rastertime;
  JDXdouble rf_rastertime;
  JDXdouble grad_rastertime;
  JDXdouble min_grad_rastertime;
  JDXdouble acq_rastertime;

  JDXint max_rf_samples;
  JDXint max_grad_samples;
  JDXstring datatype;

  JDXdoubleArr grad_reson_center;
  JDXdoubleArr grad_reson_width;


  STD_string scandir;

  dvector min_duration;

};


//////////////////////////////////////////////////////////////////////////////

/**
  * @ingroup odinpara
  *  An interface class that makes the global systemInfo look like a pointer,
  *  but requests will be delegated to the actual System object in the platform object
  */
class SystemInterface : public StaticHandler<SystemInterface> {
 public:

  SystemInterface()  {}

  System& operator *  () {return *get_sysinfo_ptr();}
  const System& operator * () const {return *get_const_sysinfo_ptr();}

  System* operator -> () {return get_sysinfo_ptr();}
  const System* operator -> () const {return get_const_sysinfo_ptr();}

  // functions to initialize/delete static members by the StaticHandler template class
  static void init_static();
  static void destroy_static();

  static void set_current_pf(odinPlatform pf);

  static odinPlatform get_current_pf() { // make it inline to speed up driver access
    if(current_pf) return odinPlatform(current_pf->operator int ());
//    else STD_cerr << "ERROR: SystemInterface::get_current_pf: current_pf not yet initialized" << STD_endl;
    return odinPlatform(0);
  }


 private:
//  friend class System;
  friend class SeqIdea;
  friend class SeqParavision;
  friend class SeqStandAlone;
  friend class SeqEpic;
//  friend class SeqPlatformInstances;


  static System* get_sysinfo_ptr();
  static const System* get_const_sysinfo_ptr();

  // the actual platform
  static SingletonHandler<JDXint,false> current_pf;

  // separate systemInfo for each platform
  static SingletonHandler<System,false>* systemInfo_platform;
};



#endif