JEMRIS  2.8.2
open-source MRI simulations
TrajectoryInterface.h
Go to the documentation of this file.
1 
8 /*
9  * JEMRIS Copyright (C)
10  * 2006-2018 Tony Stoecker
11  * 2007-2018 Kaveh Vahedipour
12  * 2009-2018 Daniel Pflugfelder
13  *
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28  */
29 
30 #ifndef TRAJECTORYINTERFACE_H_
31 #define TRAJECTORYINTERFACE_H_
32 
33 #include <string>
34 #include <vector>
35 #include <iostream>
36 #include <cstdlib>
37 #include <fstream>
38 #include <cmath>
39 
40 #include "World.h"
41 
42 using namespace std;
43 
49 public:
51  virtual ~TrajectoryInterface();
52 
56  void GetValue(double time, double *value) ;
57 
61  virtual void GetValueDerived(double time, double *value) =0;
62 
66  virtual void LoadFile(string filename) =0;
67 
68  virtual void UpdateTrajectory(bool init=false){};
69 
70 //MODIF
74  bool spinActivation(long currentSpin) { return m_spinActive; };
75 
79  void setCurrentTraj(long currentTraj) { m_currentSpinIndex=currentTraj; };
80 
84  long getCurrentTraj() { return m_currentSpinIndex; };
85 
89  void setLoop(double loopDuration, long loopTrajNumber) { m_trajLoopNumber=loopTrajNumber; m_trajLoopDuration=loopDuration; };
90 //MODIF***
91 
92 protected:
97  int GetLowerIndex(double time);
98 
99  int m_LastHuntIndex;
100 
101  vector<double> m_time;
102 //MODIF
103  vector< vector<double> > m_time_full;
104 
105  long m_currentSpinIndex;
106 
107  long m_trajLoopNumber;
108 
109  double m_trajLoopDuration;
110 
111  bool m_spinActive;
112 //MODIF***
113 
114 };
115 
116 #endif /* TRAJECTORYINTERFACE_H_ */
long getCurrentTraj()
get trajectory number associated to current spin
Definition: TrajectoryInterface.h:84
pure virtual base class for all Trajectories
Definition: TrajectoryInterface.h:48
Implementation of JEMRIS World.
void setLoop(double loopDuration, long loopTrajNumber)
set loop parameters for periodic flow
Definition: TrajectoryInterface.h:89
void setCurrentTraj(long currentTraj)
set trajectory number associated to current spin
Definition: TrajectoryInterface.h:79
bool spinActivation(long currentSpin)
get spin current state : true=active, false=unactive
Definition: TrajectoryInterface.h:74

-- last change 24.05.2018 | Tony Stoecker | Imprint | Data Protection --