JEMRIS 2.9.2
open-source MRI simulations
Loading...
Searching...
No Matches
TrajectoryInterface.h
Go to the documentation of this file.
1
8/*
9 * JEMRIS Copyright (C)
10 * 2006-2025 Tony Stoecker
11 * 2007-2018 Kaveh Vahedipour
12 * 2009-2019 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
42using namespace std;
43
49public:
51 virtual ~TrajectoryInterface();
52
56 inline
57 void GetValue(double time, double *value) {
58 if (m_time.size()>0 || m_time_full.size()>0) //MODIF
59 GetValueDerived(time,value);
60 }
61
65 virtual void GetValueDerived(double time, double *value) =0;
66
70 virtual void LoadFile(string filename) =0;
71
72 virtual void UpdateTrajectory(bool init=false){};
73
74//MODIF
78 bool spinActivation(long currentSpin) { return m_spinActive; };
79
83 void setCurrentTraj(long currentTraj) { m_currentSpinIndex=currentTraj; };
84
88 long getCurrentTraj() { return m_currentSpinIndex; };
89
93 void setLoop(double loopDuration, long loopTrajNumber) { m_trajLoopNumber=loopTrajNumber; m_trajLoopDuration=loopDuration; };
94//MODIF***
95
96protected:
101 int GetLowerIndex(double time);
102
103 int m_LastHuntIndex;
104
105 vector<double> m_time;
106//MODIF
107 vector< vector<double> > m_time_full;
108
109 long m_currentSpinIndex;
110
111 long m_trajLoopNumber;
112
113 double m_trajLoopDuration;
114
115 bool m_spinActive;
116//MODIF***
117
118};
119
120#endif /* TRAJECTORYINTERFACE_H_ */
Implementation of JEMRIS World.
pure virtual base class for all Trajectories
Definition TrajectoryInterface.h:48
virtual void GetValueDerived(double time, double *value)=0
retrieve value at given time-point
int GetLowerIndex(double time)
find data index for interpolation get lower index for given timepoint using hunt search algorithm.
Definition TrajectoryInterface.cpp:48
bool spinActivation(long currentSpin)
get spin current state : true=active, false=unactive
Definition TrajectoryInterface.h:78
void GetValue(double time, double *value)
Definition TrajectoryInterface.h:57
void setLoop(double loopDuration, long loopTrajNumber)
set loop parameters for periodic flow
Definition TrajectoryInterface.h:93
void setCurrentTraj(long currentTraj)
set trajectory number associated to current spin
Definition TrajectoryInterface.h:83
virtual void LoadFile(string filename)=0
load trajectory from file
long getCurrentTraj()
get trajectory number associated to current spin
Definition TrajectoryInterface.h:88

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