Skip to content

Commit

Permalink
add option to provide sequence object instead of seq-file
Browse files Browse the repository at this point in the history
  • Loading branch information
schuenke committed Jan 16, 2024
1 parent d6065d8 commit fd563b4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/bmctool/simulation/_BMCSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BMCSim:
def __init__(
self,
params: Parameters,
seq_file: str | Path,
seq: str | Path | pp.Sequence,
verbose: bool = True,
**kwargs,
) -> None:
Expand All @@ -25,18 +25,20 @@ def __init__(
----------
params
Parameters object containing all simulation parameters
seq_file
Path to the pulseq seq-file
seq
Path to the pulseq seq-file or PyPulseq sequence object
verbose, optional
Flag to activate detailed outpus, by default True
"""
self.params = params
self.seq_file = seq_file
self.verbose = verbose

# read pulseq sequence
self.seq = pp.Sequence()
self.seq.read(seq_file)
# load sequence
if isinstance(seq, pp.Sequence):
self.seq = seq
else:
self.seq = pp.Sequence()
self.seq.read(seq)

# get offsets from pypulseq definitions
self.defs = self.seq.definitions
Expand Down

0 comments on commit fd563b4

Please sign in to comment.