Methods list
MRIPulses.MRIPulsesMRIPulses.ab2rfMRIPulses.b2aMRIPulses.b2rfMRIPulses.calc_ripplesMRIPulses.dinfMRIPulses.dz_gslider_bMRIPulses.dz_gslider_rfMRIPulses.dz_hadamard_bMRIPulses.dz_recursive_rfMRIPulses.dzlpMRIPulses.dzlsMRIPulses.dzmpMRIPulses.dzrfMRIPulses.firlsMRIPulses.fmpMRIPulses.hadamardMRIPulses.hankelMRIPulses.lejaMRIPulses.mag2mpMRIPulses.msincMRIPulses.root_flipMRIPulses.sp_fftMRIPulses.sp_ifftMRIPulses.toeplitz
Methods usage
MRIPulses.MRIPulses — Module
MRIPulsesModule for RF pulse design in MRI.
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.
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.
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.
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).
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) Δtis the pulse durationB = (Fₚ + Fₛ) / Δtis the filter half-amplitude widthW = (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
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
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.
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.
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}orTuple{Matrix{ComplexF64}, Vector{ComplexF64}}: RF pulse(s).
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.
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 tonsamples).
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.
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:expulses, cancel alpha phase for a flatter profile.
Returns
Vector{ComplexF64}: Designed RF pulse.
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.
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.
MRIPulses.hadamard — Method
hadamard(n)Generate a Hadamard matrix of size n (must be a power of 2).
MRIPulses.hankel — Method
hankel(c, r = zeros(eltype(c), length(c)))Construct a Hankel matrix from column c and row r.
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
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.
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.
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
MRIPulses.sp_fft — Method
sp_fft(x)SigPy-style centered FFT.
MRIPulses.sp_ifft — Method
sp_ifft(x, center=true)SigPy-style centered IFFT.
MRIPulses.toeplitz — Method
toeplitz(c, r=c)Construct a Toeplitz matrix from column c and row r.