msl 1.3.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, make sure the NCO always
37 // ends after the readout
38 this->_reset.setStartTime(
39 event.getStartTime()+std::ceil(event.getDuration()));
40 }
41
43 template <typename T>
44 void update(sSLICE_POS const & slice, T && pulse, double additionalPhase=0)
45 {
46 this->_set.prepSet(slice, pulse);
47 this->_set.increasePhase(additionalPhase);
48 this->_reset.prepNeg(slice, pulse);
49 this->_reset.decreasePhase(additionalPhase);
50 }
51
53 void update(
54 sSLICE_POS const & slice, sREADOUT const & adc,
55 sGRAD_PULSE const & gradient, Vector3l const & point,
56 double additionalPhase=0);
57
59 NLS_STATUS run();
60private:
61 sFREQ_PHASE _set, _reset;
62};
63
64}
65
66#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:44
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.
Top-level namespace of the msl library.
Definition acceleration.h:17