msl 1.3.0
Loading...
Searching...
No Matches
Sequence.h
Go to the documentation of this file.
1// Copyright 2025-2026 Julien Lamy, ICube, Université de Strasbourg-CNRS.
2// Part of msl, distributed under the terms of the MIT license.
3
4#ifndef _bd7a661f_037c_40e6_8a61_e599b991a5c3
5#define _bd7a661f_037c_40e6_8a61_e599b991a5c3
6
7#include <memory>
8#include <string>
9
10#include <MrImagingFW/libSBBFW/StdSeqIF.h>
11
12#include "msl/Counter.h"
13#include "msl/DictionaryItem.h"
14#include "msl/graph/Node.h"
15#include "msl/Sampling.h"
16
18namespace msl
19{
20
36class Sequence: public StdSeqIF
37{
38public:
39 Sequence();
40 Sequence(Sequence const &) = delete;
41 Sequence(Sequence &&) = delete;
42 Sequence & operator=(Sequence const &) = delete;
43 Sequence & operator=(Sequence &&) = delete;
44 ~Sequence() override = default;
45
50 NLSStatus check(
51 MrProt & protocol, SeqLim & limits, SeqExpo & exports,
52 SEQCheckMode *) override;
53
58 NLSStatus run(
59 MrProt & protocol, SeqLim & limits, SeqExpo & exports) override;
60
62 NLS_STATUS runKernel(
63 MrProt &, SeqLim &, SeqExpo &, long, long, long, long) override;
64
66 template<typename T>
67 T const & get(std::string const & key) const
68 {
69 return this->_root->get<T>(key);
70 }
71
73 template<typename T>
74 T & get(std::string const & key)
75 {
76 return this->_root->get<T>(key);
77 }
78
80 template<typename T>
81 Sequence & set(std::string const & key, T && value)
82 {
83 this->_root->set(key, value);
84 return *this;
85 }
86
87protected:
90
93
96
99
102
105
107 Sequence & _setSampling(Sampling::Pointer sampling);
108};
109
110}
111
112#endif // _bd7a661f_037c_40e6_8a61_e599b991a5c3
Typed accessor for a dictionary item.
Definition DictionaryItem.h:22
std::shared_ptr< Sampling > Pointer
Reference-counted pointer to Sampling.
Definition Sampling.h:27
Sequence & _setSampling(Sampling::Pointer sampling)
Set the active sampling and reset the trajectories counter.
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Store the run mask as "indices" in the root node registry and run the root node.
T & get(std::string const &key)
Return an object stored in the dictionary.
Definition Sequence.h:74
graph::Node::Pointer _root
Root node of the sequence graph.
Definition Sequence.h:89
NLSStatus check(MrProt &protocol, SeqLim &limits, SeqExpo &exports, SEQCheckMode *) override
Store the check mask as "indices" in the root node registry and run the root node.
DictionaryItem< Sampling::Pointer > _activeSampling
Active sampling instance, either _runSampling or _checkSampling.
Definition Sequence.h:92
NLS_STATUS runKernel(MrProt &, SeqLim &, SeqExpo &, long, long, long, long) override
Do nothing.
DictionaryItem< long > _kernelMode
Current kernel mode, KERNEL_CHECK or KERNEL_IMAGE.
Definition Sequence.h:98
DictionaryItem< Counter > _trajectories
Counter for the trajectories of the current sampling.
Definition Sequence.h:95
Sequence & set(std::string const &key, T &&value)
Store an object in the dictionary, create it if needed.
Definition Sequence.h:81
T const & get(std::string const &key) const
Return an object stored in the dictionary.
Definition Sequence.h:67
Sampling::Pointer _checkSampling
Sampling instance used in check mode.
Definition Sequence.h:104
Sampling::Pointer _runSampling
Sampling instance used in run mode.
Definition Sequence.h:101
std::shared_ptr< Node > Pointer
Reference-counted pointer to Node.
Definition Node.h:30
Top-level namespace of the msl library.
Definition acceleration.h:17