-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathHSInversionProfile.jl
More file actions
30 lines (30 loc) · 1.1 KB
/
HSInversionProfile.jl
File metadata and controls
30 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using KomaMRI, PlotlyJS
# RF Pulse Paramters, https://onlinelibrary.wiley.com/doi/epdf/10.1002/jmri.26021?saml_referrer
b1max = 13e-6 #Peak amplitude (uT)
Trf = 18.3e-3 #Pulse duration (ms)
β = 4e2 #frequency modulation param (rad/s)
μ = 6 #phase modulation parameter (dimensionless)
fmax = μ * β / (2π) # 2fmax = BW
# Adiabatic condition b1max >> β*√μ/γ:
b1max > β*sqrt(μ)/(2π*γ)
# Pulse Shape
t = range(-Trf/2, Trf/2, 201)
B1 = b1max .* sech.(β.*t)
Δf = -fmax .* tanh.(β.*t)
# Sequence generation
fmax_sim = 2e3
Gz = fmax_sim / γ
seq = Sequence()
@addblock seq += (RF(B1, Trf, Δf, 0), z=Grad(Gz, Trf, 0))
p1 = plot_seq(seq; max_rf_samples=Inf, slider=false)
KomaMRI.get_flip_angles(seq)[1]
# Simulation
sim_params = Dict{String,Any}("Δt_rf"=>t[2]-t[1])
z = range(-1, 1, 400)
M = simulate_slice_profile(seq; sim_params, z)
# Plot
f = γ*Gz*z
s1 = scatter(x=f,y=abs.(M.xy),name="|Mxy|")
s2 = scatter(x=f,y=M.z,name="Mz")
p2 = plot([s1,s2], Layout(title="Hyperbolic-Secant (HS) Adiabatic Inversion Pulse (μ=$μ, β=$β rad/s)", xaxis_title="Frequency [Hz]"))
[p1; p2]