From 8adffd197e7c034d9677536ab74367bb3cb87464 Mon Sep 17 00:00:00 2001 From: Patrick Schuenke Date: Fri, 4 Jun 2021 09:24:04 +0200 Subject: [PATCH] update write_WASABI and move it to examples --- README.md | 6 ++++-- .../write_WASABI.py | 17 ++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) rename bmctool/library/write_wasabi_seq.py => examples/write_WASABI.py (86%) diff --git a/README.md b/README.md index 051e233..cb35a9b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bmctool/library/write_wasabi_seq.py b/examples/write_WASABI.py similarity index 86% rename from bmctool/library/write_wasabi_seq.py rename to examples/write_WASABI.py index d1ff843..3aea551 100644 --- a/bmctool/library/write_wasabi_seq.py +++ b/examples/write_WASABI.py @@ -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 @@ -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 = {} @@ -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) @@ -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()