Skip to content

Commit

Permalink
Merge pull request #22 from schuenke/dev
Browse files Browse the repository at this point in the history
update write_WASABI and move it to examples
  • Loading branch information
schuenke committed Jun 4, 2021
2 parents 3107510 + 8adffd1 commit 0d0afc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ These are for example _normalize_ (bool: toggle normalization), _norm_threshold_
normalization offsets), _offsets_ (list/array: manually defined x-values), _invert_ax_ (bool: toggle invert ax),
_plot_mtr_asym_ (bool:toggle plot MTR_asym) and _title_, _x_label_, _y_label_ to control the lables.

The [BMCTool GitHub repository](https://github.com/schuenke/BMCTool) contains some further pre-defined examples in the
[examples folder](examples).
The [examples folder](examples) in the [BMCTool GitHub repository](https://github.com/schuenke/BMCTool) contains some
further simulation examples as well as an example script to create your own _WASABI.seq_ file. _Please note that this
file will include an additional normalization offset at -300 ppm. To use this for normalization in the simulation,
simply add the kewword argument ``normalize=True`` to the simulate function._

## Pulseq-CEST Project
The BMCTool was developed in parallel to the [pulseq-cest project](https://pulseq-cest.github.io/) that aims to provide
Expand Down
17 changes: 6 additions & 11 deletions bmctool/library/write_wasabi_seq.py → examples/write_WASABI.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
T_rec = 2/12 s (saturated/M0)
"""

import os
import numpy as np
from pypulseq.Sequence.sequence import Sequence
from pypulseq.make_adc import make_adc
Expand All @@ -21,13 +20,10 @@
from pypulseq.opts import Opts
from bmctool.utils.seq.write import write_seq

# get id of generation file
seqid = os.path.splitext(os.path.basename(__file__))[0]

# general settings
seqid = 'WASABI'
author = 'Patrick Schuenke'
plot_sequence = False # plot preparation block?
convert_to_1_3 = True # convert seq-file to a pseudo version 1.3 file?
plot_sequence = True # plot preparation block?

# sequence definitions (everything in seq_defs will be written to definitions of the .seq-file)
seq_defs:dict = {}
Expand Down Expand Up @@ -66,7 +62,7 @@

# RF pulses
flip_angle_sat = seq_defs['b1cwpe'] * gamma_hz * 2 * np.pi * seq_defs['tp']
rf_pulse, _ = make_block_pulse(flip_angle=flip_angle_sat, duration=seq_defs['tp'], system=sys)
rf_pulse = make_block_pulse(flip_angle=flip_angle_sat, duration=seq_defs['tp'], system=sys)

# ADC events
pseudo_adc = make_adc(num_samples=1, duration=1e-3) # (not played out; just used to split measurements)
Expand Down Expand Up @@ -105,11 +101,10 @@

write_seq(seq=seq,
seq_defs=seq_defs,
filename=seqid+'_py.seq',
filename=seqid+'.seq',
author=author,
use_matlab_names=True,
convert_to_1_3=convert_to_1_3)
use_matlab_names=True)

# plot the sequence
if plot_sequence:
seq.plot(time_range=[0, seq_defs['trec_m0']+seq_defs['tsat']]) # to plot all offsets, remove time_range argument
seq.plot()

0 comments on commit 0d0afc7

Please sign in to comment.