This file is indexed.

/usr/include/odinseq/seqfreq.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
/***************************************************************************
                          seqfreq.h  -  description
                             -------------------
    begin                : Wed Aug 14 2002
    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 SEQFREQ_H
#define SEQFREQ_H

#include <odinseq/seqclass.h>
#include <odinseq/seqvec.h>
#include <odinseq/seqphase.h>
#include <odinseq/seqdriver.h>


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

/**
  * @ingroup odinseq_internals
  * Abstract interfac class for all sequence objects that occupy a
  * transmitter/receiver channel, e.g. pulse objects or acquisition objects 
  */
class SeqFreqChanInterface : public virtual SeqClass  {

 public:
/**
  * Specify the nucleus for this frequency channel
  */
  virtual SeqFreqChanInterface& set_nucleus(const STD_string& nucleus) {if(marshall) marshall->set_nucleus(nucleus); else marshall_error(); return *this;}


/**
  * Sets the freqlist for the object
  */
  virtual SeqFreqChanInterface& set_freqlist(const dvector& freqlist) {if(marshall) marshall->set_freqlist(freqlist); else marshall_error(); return *this;}

/**
  * Sets the phaselist for the object
  */
  virtual SeqFreqChanInterface& set_phaselist(const dvector& phaselist) {if(marshall) marshall->set_phaselist(phaselist); else marshall_error(); return *this;}

/**
  * Returns the frequency list vector (for loop insertion)
  */
  virtual const SeqVector& get_freqlist_vector() const {if(marshall) return marshall->get_freqlist_vector(); else marshall_error(); return get_dummyvec();}


/**
  * Returns the phaselist vector (for loop insertion)
  */
  virtual const SeqVector& get_phaselist_vector() const {if(marshall) return marshall->get_phaselist_vector(); else marshall_error(); return get_dummyvec();}

/**
  * Returns the frequency list vector (for loop insertion)
  */
  operator const SeqVector& () const {return get_freqlist_vector();}

/**
  * Sets the frequency encoding scheme
  */
  virtual SeqFreqChanInterface& set_encoding_scheme(encodingScheme scheme) {if(marshall) marshall->get_mutable_freqlist_vector().set_encoding_scheme(scheme); else marshall_error(); return *this;}

/**
  * Sets the reordering scheme for the frequency list
  */
  virtual SeqFreqChanInterface& set_reorder_scheme(reorderScheme scheme, unsigned int nsegments=1) {if(marshall) marshall->get_mutable_freqlist_vector().set_reorder_scheme(scheme,nsegments); else marshall_error(); return *this;}

/**
  * Returns the reordering vector of the frequency list (for loop insertion)
  */
  virtual const SeqVector& get_reorder_vector() const {if(marshall) return marshall->get_freqlist_vector().get_reorder_vector(); else marshall_error(); return get_dummyvec();}

/**
  * Sets the encoding scheme of the phase list
  */
  virtual SeqFreqChanInterface& set_phaselist_encoding_scheme(encodingScheme scheme) {if(marshall) marshall->get_mutable_phaselist_vector().set_encoding_scheme(scheme); else marshall_error(); return *this;}

/**
  * Sets the reordering scheme for the phase list
  */
  virtual SeqFreqChanInterface& set_phaselist_reorder_scheme(reorderScheme scheme, unsigned int nsegments=1) {if(marshall) marshall->get_mutable_phaselist_vector().set_reorder_scheme(scheme,nsegments); else marshall_error(); return *this;}

/**
  * Returns the reordering vector of the phase list (for loop insertion)
  */
  virtual const SeqVector& get_phaselist_reorder_vector() const {if(marshall) return marshall->get_phaselist_vector().get_reorder_vector(); else marshall_error(); return get_dummyvec();}


/**
  * Sets the frequency list to a single value 'freqoffset'
  */
  SeqFreqChanInterface& set_freqoffset(double freqoffset);

/**
  * Sets the phase list to a single value 'phaseval'
  */
  SeqFreqChanInterface& set_phase(double phaseval);

/**
  * Sets a phase list for RF spoiling of length 'size', multiplicator 'incr' and uniform 'offset'.
  * Defaults are recommended by the 'Handbook of MRI'
  */
  SeqFreqChanInterface& set_phasespoiling(unsigned int size=80, double incr=117.0, double offset=0.0);

 protected:
  SeqFreqChanInterface() {}
  virtual ~SeqFreqChanInterface() {}

  void set_marshall(SeqFreqChanInterface* mymarshall) {marshall=mymarshall;} // to be used in constructor code

 private:
  friend class SeqAcqEPI; // to allow SeqAcqEPI full access to its driver

  SeqFreqChanInterface* marshall; // for marshalling member functions to a sub-object


  virtual SeqVector& get_mutable_freqlist_vector() {if(marshall) return marshall->get_mutable_freqlist_vector(); else marshall_error(); return get_dummyvec();}
  virtual SeqVector& get_mutable_phaselist_vector() {if(marshall) return marshall->get_mutable_phaselist_vector(); else marshall_error(); return get_dummyvec();}

};


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

/**
  * @ingroup odinseq_internals
  * The base class for platform specific drivers of transmit/receive channels
  */
class SeqFreqChanDriver : public SeqDriverBase {

 public:
  SeqFreqChanDriver() {}
  virtual ~SeqFreqChanDriver() {}

  virtual bool prep_driver(const STD_string& nucleus, const dvector& freqlist) = 0;
  virtual void prep_iteration(double current_frequency, double current_phase, double freqchan_duration) const = 0;
  virtual int get_channel() const = 0;

  virtual STD_string get_iteratorcommand(objCategory cat,int freqlistindex) const = 0;
  virtual svector get_freqvec_commands(const STD_string& iterator, const STD_string& instr) const = 0;

  virtual STD_string get_pre_program(programContext& context, objCategory cat, const STD_string& instr_label, double default_frequency, double default_phase) const = 0;


  virtual SeqFreqChanDriver* clone_driver() const = 0;

  virtual void pre_event (eventContext& context,double starttime) const = 0;
  virtual void post_event(eventContext& context,double starttime) const = 0;
};

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

/**
  * @ingroup odinseq_internals
  * This is the base class for all sequence objects that occupy a
  * transmitter/receiver channel
  */
class SeqFreqChan : public SeqVector, public virtual SeqFreqChanInterface {

 public:
/**
  * Constructs an empty frequency channel labeled 'object_label'
  */
  SeqFreqChan(const STD_string& object_label="unnamedSeqFreqChan");


/**
  * Constructs a frequency channel labeled 'object_label' with the following properties:
  * - nucleus:     The nucleus for which the frequency channel should be reserved.
  *                 The default is the protons resonance frequency.
  * - freqlist:    This is an array of frequencies at which the transmit/receive signal will be
  *                modulated/demodulated.
  * - phaselist:   This is an array of phases at which the transmit/receive signal will be
  *                modulated/demodulated.
  */
  SeqFreqChan(const STD_string& object_label,const STD_string& nucleus,
                  const dvector& freqlist=0,const dvector& phaselist=0);


/**
  * Constructs a copy of 'sfc'
  */
  SeqFreqChan(const SeqFreqChan& sfc);


/**
  * Destructor
  */
  virtual ~SeqFreqChan() {}


/**
  * Assignment operator that makes this frequency channel become a copy of 'sfc'
  */
  SeqFreqChan& operator = (const SeqFreqChan& sfc);


/**
  * Return the assigned number of this frequency channel
  */
  int get_channel() const {return freqdriver->get_channel();}


/**
  * Returns the freqlist of the object
  */
  dvector get_freqlist() const {return frequency_list;}


/**
  * Returns the current phase (in rad !)
  */
  double get_phase() const {return phaselistvec.get_phase();}


/**
  * Returns the current frequency
  */
  virtual double get_frequency() const;


/**
  * Return the index for the phase list
  */
  unsigned int get_phaselistindex() const {return phaselistvec.get_phaselistindex();}


/**
  * Return the index for the frequency list
  */
  virtual unsigned int get_freqlistindex() const {return 1;}


/**
  * Returns the command to iterate through the frequency list
  */
  STD_string get_iteratorcommand(objCategory cat) const;



  // overloaded virtual functions of SeqFreqChanInterface
  SeqFreqChanInterface& set_nucleus(const STD_string& nucleus);
  SeqFreqChanInterface& set_freqlist (const dvector& freqlist) {frequency_list=freqlist; return *this;}
  SeqFreqChanInterface& set_phaselist(const dvector& phaselist) {phaselistvec.set_phaselist(phaselist); return *this;}
  const SeqVector& get_freqlist_vector() const {return *this;}
  const SeqVector& get_phaselist_vector() const {return phaselistvec;}


  // overloaded virtual functions of SeqVector
  unsigned int get_vectorsize() const {return frequency_list.size();}
  bool prep_iteration() const;
  bool is_qualvector() const {return false;}
  svector get_vector_commands(const STD_string& iterator) const {return freqdriver->get_freqvec_commands(iterator,get_driver_instr_label());}

  // overloaded functions for SeqTreeObj
  SeqValList get_freqvallist(freqlistAction action) const;


 protected:

  STD_string get_pre_program(programContext& context, objCategory cat, const STD_string& instr_label) const;

  void pre_event (eventContext& context,double starttime) const {freqdriver->pre_event(context,starttime);}
  void post_event(eventContext& context,double starttime) const {freqdriver->post_event(context,starttime);}

/**
  * Overload this function to return the duration of the object
  * while it effectively occupies the RF channel
  */
  virtual double get_freqchan_duration() const {return 0.0;}

  // overwriting virtual functions from SeqClass
  bool prep();

 private:
  friend class SeqPhaseListVector;

  // overloaded virtual functions of SeqFreqChanInterface
  SeqVector& get_mutable_freqlist_vector() {return *this;}
  SeqVector& get_mutable_phaselist_vector() {return phaselistvec;}


  double get_default_phase() const {return closest2zero(phaselistvec.get_phaselist());}
  double get_default_frequency() const {return closest2zero(frequency_list);}

  static double closest2zero(const dvector& v);

  // for EPIC
  virtual STD_string get_driver_instr_label() const {return "";}


  // the hardware driver
  mutable SeqDriverInterface<SeqFreqChanDriver> freqdriver;

  // the nucleus of this freq/phase object
  STD_string nucleusName;

  // the frequency list to iterate through
  dvector frequency_list;

  // the phaselist associated with this freq/phase object
  SeqPhaseListVector phaselistvec;
};

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

#endif