msl 1.1.0
 
Loading...
Searching...
No Matches
NCOPair.h
Go to the documentation of this file.
1// Copyright 2025 Julien Lamy, ICube, Université de Strasbourg-CNRS.
2// Part of msl, distributed under the terms of the MIT license.
3
4#ifndef _8c24ac6b_445b_442f_a45b_1f44e54f5720
5#define _8c24ac6b_445b_442f_a45b_1f44e54f5720
6
7#include <cmath>
8
9#include <MrGlobalDefinitions/MrResult.h>
10
11#include <MrMeasSrv/SeqIF/libRT/sFREQ_PHASE.h>
12#include <MrMeasSrv/SeqIF/libRT/sGRAD_PULSE.h>
13#include <MrMeasSrv/SeqIF/libRT/sREADOUT.h>
14#include <MrMeasSrv/SeqIF/libRT/sSLICE_POS.h>
15
16#include "msl/Vector.h"
17
18namespace msl
19{
20
26{
27public:
32 template <typename T>
33 void setTime(T && event)
34 {
35 this->_set.setStartTime(event.getStartTime());
36 // NOTE: sREADOUT has a non-integer duration
37 this->_reset.setStartTime(
38 event.getStartTime()+std::lround(event.getDuration()));
39 }
40
42 template <typename T>
43 void update(sSLICE_POS const & slice, T && pulse, double additionalPhase=0)
44 {
45 this->_set.prepSet(slice, pulse);
46 this->_set.increasePhase(additionalPhase);
47 this->_reset.prepNeg(slice, pulse);
48 this->_reset.decreasePhase(additionalPhase);
49 }
50
52 void update(
53 sSLICE_POS const & slice, sREADOUT const & adc,
54 sGRAD_PULSE const & gradient, Vector3l const & point,
55 double additionalPhase=0);
56
58 NLS_STATUS run();
59private:
60 sFREQ_PHASE _set, _reset;
61};
62
63}
64
65#endif // _8c24ac6b_445b_442f_a45b_1f44e54f5720
Encapsulation of a pair of NCO objects, setting and resetting the frequency and the phase of the NCO ...
Definition NCOPair.h:26
void setTime(T &&event)
Set the frequency/phase at the start of the real-time and reset it at the end.
Definition NCOPair.h:33
void update(sSLICE_POS const &slice, T &&pulse, double additionalPhase=0)
Update the frequency and phase of a pulse-related NCO.
Definition NCOPair.h:43
void update(sSLICE_POS const &slice, sREADOUT const &adc, sGRAD_PULSE const &gradient, Vector3l const &point, double additionalPhase=0)
Update the frequency and phase of readout gradient-related NCO.
NLS_STATUS run()
Run the NCO pair.
Definition acceleration.h:17
Vector< 3, long > Vector3l
3D vector of longs
Definition Vector.h:113