Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/scripts/write_2Dt1_mprage.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
apodization=0.5,
time_bw_product=4,
return_gz=True,
use='excitation',
)

flip90 = 90 * pi / 180
rf90 = pp.make_block_pulse(flip_angle=flip90, system=system, duration=500e-6, time_bw_product=4)
rf90 = pp.make_block_pulse(flip_angle=flip90, system=system, duration=500e-6, time_bw_product=4, use='preparation')

# =========
# Readout
Expand Down
6 changes: 4 additions & 2 deletions examples/scripts/write_3Dt1_mprage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
# RF preparatory, excitation
# =========
flip_exc = 12 * pi / 180
rf = pp.make_block_pulse(flip_angle=flip_exc, system=system, duration=250e-6, time_bw_product=4)
rf = pp.make_block_pulse(flip_angle=flip_exc, system=system, duration=250e-6, time_bw_product=4, use='excitation')

flip_prep = 90 * pi / 180
rf_prep = pp.make_block_pulse(flip_angle=flip_prep, system=system, duration=500e-6, time_bw_product=4)
rf_prep = pp.make_block_pulse(
flip_angle=flip_prep, system=system, duration=500e-6, time_bw_product=4, use='preparation'
)

# =========
# Readout
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'epi_p
time_bw_product=4,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Define other gradients and ADC events
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_epi_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'epi_l
time_bw_product=4,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Define trigger
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_epi_se.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'epi_s
time_bw_product=4,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Define other gradients and ADC events
Expand Down
2 changes: 2 additions & 0 deletions examples/scripts/write_epi_se_rs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'epi_s
bandwidth=np.abs(sat_freq),
freq_offset=sat_freq,
delay=system.rf_dead_time,
use='saturation',
)
gz_fs = pp.make_trapezoid(channel='z', system=system, delay=pp.calc_duration(rf_fs), area=1 / 1e-4)

Expand All @@ -70,6 +71,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'epi_s
time_bw_product=4,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Create 90 degree slice refocusing pulse and gradients
Expand Down
10 changes: 7 additions & 3 deletions examples/scripts/write_gre.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pypulseq as pp


def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_pypulseq.seq'):
def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_pypulseq.seq', paper_plot: bool = False):
# ======
# SETUP
# ======
Expand Down Expand Up @@ -44,6 +44,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_p
system=system,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)
# Define other gradients and ADC events
delta_k = 1 / fov
Expand Down Expand Up @@ -120,7 +121,10 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_p
# VISUALIZATION
# ======
if plot:
seq.plot()
if paper_plot:
seq.paper_plot()
else:
seq.plot()

seq.calculate_kspace()

Expand All @@ -143,4 +147,4 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_p


if __name__ == '__main__':
main(plot=False, write_seq=True)
seq = main(plot=True, paper_plot=True, write_seq=False)
1 change: 1 addition & 0 deletions examples/scripts/write_gre_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_l
system=system,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Define other gradients and ADC events
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_haste.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'haste
phase_offset=rfex_phase,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)
GS_ex = make_trapezoid(
channel='z',
Expand Down
11 changes: 9 additions & 2 deletions examples/scripts/write_mprage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'mprag
ax.n3 = xyz.index(ax.d3)

# Create alpha-degree hard pulse and gradient
rf = pp.make_block_pulse(flip_angle=alpha * np.pi / 180, system=system, duration=rf_len, delay=system.rf_dead_time)
rf = pp.make_block_pulse(
flip_angle=alpha * np.pi / 180, system=system, duration=rf_len, delay=system.rf_dead_time, use='excitation'
)
rf180 = pp.make_adiabatic_pulse(
pulse_type='hypsec', system=system, duration=10.24e-3, dwell=1e-5, delay=system.rf_dead_time
pulse_type='hypsec',
system=system,
duration=10.24e-3,
dwell=1e-5,
delay=system.rf_dead_time,
use='inversion',
)

# Define other gradients and ADC events
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_radial_gre.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'gre_r
time_bw_product=4,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Define other gradients and ADC events
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_tse.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'tse_p
phase_offset=rf_ex_phase,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)
gs_ex = pp.make_trapezoid(
channel='z',
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/write_ute.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def main(plot: bool = False, write_seq: bool = False, seq_filename: str = 'ute_p
system=system,
return_gz=True,
delay=system.rf_dead_time,
use='excitation',
)

# Align RO asymmetry to ADC samples
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pypulseq"
version = "1.4.2.post1"
version = "1.5.0"
authors = [{ name = "Keerthi Sravan Ravi", email = "ks3621@columbia.edu" }]
maintainers = [
{ name = "Bilal Tasdelen" },
Expand All @@ -28,6 +28,7 @@ dependencies = [

[project.optional-dependencies]
sigpy = ["sigpy>=0.1.26"]
mplcursors = ["mplcursors"]
test = [
"coverage",
"codecov",
Expand Down
Loading
Loading