Methods list

Methods usage

MRIPulses.ab2rf — Method
ab2rf(a, b)

Inverse SLR transform: alpha/beta polynomials to RF pulse.

Arguments

  • a::AbstractVector: SLR alpha parameter.
  • b::AbstractVector: SLR beta parameter.

Returns

  • Vector{ComplexF64}: Designed RF pulse.
source
MRIPulses.b2a — Method
b2a(b)

Convert an SLR beta parameter to its minimum-phase alpha parameter.

Arguments

  • b::AbstractVector: SLR beta parameter.

Returns

  • Vector{ComplexF64}: Minimum-phase SLR alpha parameter.
source
MRIPulses.b2rf — Function
b2rf(b, cancel_alpha_phs=false)

Convert an SLR beta parameter to an RF pulse.

Arguments

  • b::AbstractVector: SLR beta parameter.
  • cancel_alpha_phs::Bool: Cancel alpha phase?

Returns

  • Vector{ComplexF64}: Designed RF pulse.
source
MRIPulses.calc_ripples — Method
calc_ripples(ptype=:st, d1=0.01, d2=0.01)

Calculate effective SLR ripple levels for a specific pulse type.

Arguments

  • ptype::Symbol: Pulse type.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.

Returns

  • Tuple{Real, Real, Real}: (bsf, d1, d2).
source
MRIPulses.dinf — Function
dinf(d1 = 0.01, d2 = 0.01)

Calculate D_∞ for a linear phase filter. From eqn. (20) in the Pauly reference below, D_∞ = T ⋅ B ⋅ W where

  • T = (N-1) Δt is the pulse duration
  • B = (Fₚ + Fₛ) / Δt is the filter half-amplitude width
  • W = (Fₚ - Fₛ) / (Fₚ + Fₛ) is the fractional transition width.

Arguments

  • d1::Real: passband ripple level in M0⁻¹.
  • d2::Real: stopband ripple level in M0⁻¹.

Returns

  • Real: D infinity.

References

Pauly, Le Roux, Nishimura, Macovski: Parameter relations for the Shinnar-Le Roux selective excitation pulse design algorithm. IEEE Tr Medical Imaging 1991; 10(1):53-65. https://doi.org/10.1109/42.75611

source
MRIPulses.dz_gslider_b — Function
dz_gslider_b(n=128, g=5, gind=1, tb=4, d1=0.01, d2=0.01, phi=π, shift=32)

Design a gSlider SLR beta parameter.

Arguments

  • n::Int: Number of time points.
  • g::Int: Number of sub-slices.
  • gind::Int: Sub-slice index.
  • tb::Real: Time-bandwidth product.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.
  • phi::Real: Sub-slice phase.
  • shift::Int: Number of time points shift of pulse.

Returns

  • Vector{ComplexF64}: SLR beta parameter.

References

  • Setsompop, K. et al. (2018). 'High-resolution in vivo diffusion imaging of the human brain with generalized slice dithered enhanced resolution: Simultaneous multislice (gSlider-SMS)'. Magn. Reson. Med. 79, 141–151. https://doi.org/10.1002/mrm.26653
source
MRIPulses.dz_gslider_rf — Method
dz_gslider_rf(n=256, g=5, flip=π/2, phi=π, tb=12, d1=0.01, d2=0.01, cancel_alpha_phs=true)

Design a gSlider RF pulse.

source
MRIPulses.dz_hadamard_b — Function
dz_hadamard_b(n=128, g=5, gind=1, tb=4, d1=0.01, d2=0.01, shift=32)

Design a Hadamard-encoded SLR beta parameter.

source
MRIPulses.dz_recursive_rf — Method
dz_recursive_rf(; n_seg, tb, n, ...)

Recursive SLR pulse design for variable flip angle or spin-echo sequences.

Arguments

  • n_seg::Int: Number of segments designed by recursion.
  • tb::Real: Time-bandwidth product.
  • n::Int: Pulse length.
  • se_seq::Bool: Spin-echo sequence.
  • tb_ref::Real: Time-bandwidth product of refocusing pulse.
  • z_pad_fact::Real: Zero padding factor.
  • win_fact::Real: Applied window factor.
  • cancel_alpha_phs::Bool: Absorb alpha phase for flatter phase.
  • t1::Real: T1 relaxation time.
  • tr_seg::Real: Length of TR segment.
  • use_mz::Bool: Design pulses accounting for actual Mz profile.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.
  • d1se::Real: Passband ripple level for spin-echo.
  • d2se::Real: Stopband ripple level for spin-echo.

Returns

  • Matrix{ComplexF64} or Tuple{Matrix{ComplexF64}, Vector{ComplexF64}}: RF pulse(s).
source
MRIPulses.dzlp — Function
dzlp(n=64, tb=4, d1=0.01, d2=0.01)

Design a linear-phase FIR filter using the Remez exchange algorithm.

Arguments

  • n::Int: Number of time points.
  • tb::Real: Time-bandwidth product.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.

Returns

  • Vector{Float64}: Designed filter coefficients.
source
MRIPulses.dzls — Function
dzls(n=64, tb=4, d1=0.01, d2=0.01)

Design a linear-phase FIR filter using the least-squares error minimization method.

Arguments

  • n::Int: Number of time points.
  • tb::Real: Time-bandwidth product.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.

Returns

  • Vector{Float64}: Designed filter coefficients (truncated to n samples).
source
MRIPulses.dzmp — Function
dzmp(n=64, tb=4, d1=0.01, d2=0.01)

Design a minimum-phase FIR filter.

Arguments

  • n::Int: Number of time points.
  • tb::Real: Time-bandwidth product.
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.

Returns

  • Vector{ComplexF64}: Designed minimum-phase filter coefficients.
source
MRIPulses.dzrf — Method
dzrf(n=64, tb=4, ptype=:st, ftype=:ls, d1=0.01, d2=0.01, cancel_alpha_phs=false)

Primary function for design of pulses using the Shinnar-Le Roux (SLR) algorithm.

Arguments

  • n::Int: Number of time points.
  • tb::Real: pulse time bandwidth product.
  • ptype::Symbol: pulse type, :st (small-tip), :ex (π/2), :se (spin-echo), :inv (inversion), :sat (saturation).
  • ftype::Symbol: type of filter: :ms (sinc), :pm (Parks-McClellan), :min (minphase), :max (maxphase), :ls (least squares).
  • d1::Real: Passband ripple level.
  • d2::Real: Stopband ripple level.
  • cancel_alpha_phs::Bool: For :ex pulses, cancel alpha phase for a flatter profile.

Returns

  • Vector{ComplexF64}: Designed RF pulse.
source
MRIPulses.firls — Method
firls(numtaps, bands, desired; weight=ones(length(desired)÷2))

FIR filter design using least-squares error minimization. Translated from SciPy's signal.firls.

Arguments

  • numtaps::Int: Number of taps in the FIR filter. Must be odd.
  • bands::AbstractVector: Monotonic non-decreasing sequence of band edges.
  • desired::AbstractVector: Desired gain at the start and end of each band.
  • weight::AbstractVector: Relative weighting for each band.

Returns

  • Vector{Float64}: Optimal FIR filter coefficients.
source
MRIPulses.fmp — Method
fmp(h)

Convert a linear-phase filter h to its minimum-phase equivalent.

Arguments

  • h::AbstractVector: Linear-phase filter coefficients.

Returns

  • Vector{ComplexF64}: Minimum-phase filter coefficients.
source
MRIPulses.hankel — Method
hankel(c, r = zeros(eltype(c), length(c)))

Construct a Hankel matrix from column c and row r.

source
MRIPulses.leja — Method
leja(r)

Order roots r using Leja ordering for numerical stability.

See Reichel, LAA, 1991: https://doi.org/10.1016/0024-3795(91)90386-B

source
MRIPulses.mag2mp — Method
mag2mp(x)

Convert a magnitude spectrum x to its minimum-phase equivalent.

Arguments

  • x::AbstractVector: Magnitude spectrum.

Returns

  • Vector{ComplexF64}: Minimum-phase filter.
source
MRIPulses.msinc — Function
msinc(n=64, m=1.0)

Generate a Hamming-windowed sinc pulse with m lobes.

Arguments

  • n::Int: Number of time points.
  • m::Real: Number of lobes.

Returns

  • Vector{Float64}: Windowed sinc pulse.
source
MRIPulses.root_flip — Method
root_flip(b, d1, flip, tb)

Exhaustive root-flip pattern search for minimum peak B1.

Arguments

  • b::AbstractVector: SLR beta parameter.
  • d1::Real: Passband ripple level.
  • flip::Real: Target flip angle.
  • tb::Real: pulse time bandwidth product.

Returns

  • Tuple{Vector{ComplexF64}, Vector{Float64}}: (rf_out, b_out).

References

  • Sharma, A., Lustig, M. and Grissom, W. (2016).

'Root-flipped multiband refocusing pulses'. Magn. Reson. Med. 75(1), 227-237. https://doi.org/10.1002/mrm.25629

source