This file is indexed.

/usr/include/odinpara/sample.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
/***************************************************************************
                          sample.h  -  description
                             -------------------
    begin                : Mon Jul 11 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 SAMPLE_H
#define SAMPLE_H

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

/**
  * @addtogroup odinpara
  * @{
  */



/**
  * Dimension inidices of the 5-dim sample grid
  * - frameDim: time dimension
  * - freqDim: frequency direction
  * - zDim: axial direction of the scanner coordinate system
  * - yDim: 2nd transversal direction of the scanner coordinate system
  * - xDim: 1st transversal direction of the scanner coordinate system
  */
enum sampleDim { frameDim=0, freqDim, zDim, yDim, xDim, n_sampleDim };


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


/**
  * \brief Virtual Sample for Simulation
  *
  * Class to store properties of a virtual sample which is used as input to
  * simulation. The arrays are 4-dimensional: one frequency dimension
  * and 3 spatial dimensions. Coordinates are in the laboratory frame of
  * reference.
  */
class Sample : public JcampDxBlock {

 public:

/**
  * Constructs a sample consisting of single voxel with the given label and the parameters:
  * - uniformFOV:  A uniform FOV is used in each spatial dimension
  * - uniformT1T2: Uniform relaxation constants T1 and T2 are used, set_T1/2map has no effect
  */
  Sample(const STD_string& label="unnamedSample", bool uniformFOV=true, bool uniformT1T2=false);

/**
  * Constructs a copy of 'ss'
  */
  Sample(const Sample& ss);

/**
  * Assignment operator that makes this Sample become a copy of 'ss'
  */
  Sample& operator = (const Sample& ss);

/**
  * Sets the uniform FOV of the sample
  */
  Sample& set_FOV(float fov);

/**
  * Sets the FOV of the sample in the given direction
  */
  Sample& set_FOV(axis direction, float fov);

/**
  * Returns the FOV of the sample in the given direction
  */
  float get_FOV(axis direction) const;

/**
  * Sets the spatial offset in the given direction
  */
  Sample& set_spatial_offset(axis direction, float offs) {offset[direction]=offs; return *this;}

/**
  * Returns the spatial offset in the given direction
  */
  float get_spatial_offset(axis direction) const {return offset[direction];}

/**
  * Sets the frequency range
  */
  Sample& set_freqrange(float range) {freqrange=range; return *this;}

/**
  * Returns the frequency range
  */
  float get_freqrange() const {return freqrange;}

/**
  * Sets the frequency offset
  */
  Sample& set_freqoffset(float offs) {freqoffset=offs; return *this;}

/**
  * Returns the frequency offset
  */
  float get_freqoffset() const {return freqoffset;}


/**
  * Sets a vector of time intervals to cycle through frames periodically.
  * For maps with a time dimension, the index of the current interval
  * will also be used to index the time dimension of the map.
  */
  Sample& set_frame_durations(const dvector& intervals) {frameDurations=intervals; return *this;}

/**
  * Returns the vector of time intervals of the frames.
  */
  const dvector& get_frame_durations() const {return frameDurations;}


/**
  * Resize the sample in the four dimensions according to the given sizes:
  * - framesize: Number of frames (time intervals)
  * - freqsize: Number of frequency intervals
  * - zsize:  Spatial extent in the axial direction of the scanner coordinate system
  * - ysize:  Spatial extent in the 2nd transversal direction of the scanner coordinate system
  * - xsize:  Spatial extent in the 1st transversal direction of the scanner coordinate system
  */
  Sample& resize(unsigned int framesize, unsigned int freqsize, unsigned int zsize, unsigned int ysize, unsigned int xsize);

/**
  * Returns the extent vector
  */
  const ndim& get_extent() const {return spinDensity.get_extent();}

/**
  * Sets a uniform longitudinal relaxation time
  */
  Sample& set_T1(float relaxation_time) {T1=relaxation_time; haveT1map=false; return *this;}

/**
  * Sets a uniform transverse relaxation time
  */
  Sample& set_T2(float relaxation_time) {T2=relaxation_time; haveT2map=false; return *this;}

/**
  * Sets an array for the longitudinal relaxation time
  */
  Sample& set_T1map(const farray& t1map);

/**
  * Returns the array for the longitudinal relaxation time
  */
  const farray& get_T1map() const;

/**
  * Sets an array for the transverse relaxation time
  */
  Sample& set_T2map(const farray& t2map);

/**
  * Returns the array for the transverse relaxation time
  */
  const farray& get_T2map() const;

/**
  * Sets an array for the relative frequency offset (in ppm)
  */
  Sample& set_ppmMap(const farray& ppmmap);

/**
  * Returns an array for the relative frequency offset (in ppm)
  */
  const farray& get_ppmMap() const;

/**
  * Sets an array for the spin density of each voxel
  */
  Sample& set_spinDensity(const farray& sd);

/**
  * Returns an array for the spin density of each voxel
  */
  const farray& get_spinDensity() const;

/**
  * Sets the diffusion coefficient map
  */
  Sample& set_DcoeffMap(const farray& dmap);

/**
  * Returns the diffusion coefficient map
  */
  const farray& get_DcoeffMap() const;

/**
  * Updates all parameter relations
  */
  Sample& update();


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


 private:
  friend class SeqSimMagsi;

  int append_all_members();

  bool check_and_correct(const char* mapname, const farray& srcmap, farray& dstmap);


  JDXfloat FOVall;
  JDXtriple FOV;
  bool uniFOV;
  JDXtriple offset;

  JDXfloat freqrange;
  JDXfloat freqoffset;

  JDXdoubleArr frameDurations;

  mutable JDXfloatArr spinDensity;

  bool uniT1T2;
  JDXfloat T1;
  JDXfloat T2;
  mutable JDXfloatArr T1map;
  mutable JDXfloatArr T2map;
  mutable bool haveT1map;
  mutable bool haveT2map;

  mutable JDXfloatArr ppmMap;
  mutable bool have_ppmMap;

  mutable JDXfloatArr DcoeffMap;
  mutable bool have_DcoeffMap;

};


/** @}
  */

#endif