Skip to content

InterpTrajTime ​

Interpolate measured or predicted field coefficients to the ADC times. The two-dimensional input stores field samples in rows and coefficients in columns. This operation shifts time coordinates; it does not integrate fields or change their spatial units.

For input index j=1,…,nfield, the interpolation support is

tj=(j−1)dt−delTime.

Thus a positive offset evaluates the unshifted field at tADC+delTime. Values outside the shifted interval are zero, which should not be mistaken for measured zero field.

Check the sign on a linear signal ​

This complete example uses matching Float32 times and a linear interpolation method. All requested points lie inside the shifted input interval.

julia
using HighOrderMRI
using Interpolations: LinearMonotonicInterpolation

T = Float32
dt = T(1e-3)
field_times = T.(0:5) .* dt
coefficients = hcat(field_times, 2 .* field_times)
adc_times = field_times[1:3]
shifted = InterpTrajTime(coefficients, dt, dt, adc_times;
    intermode=LinearMonotonicInterpolation())
@assert shifted[:, 1] ≈ adc_times .+ dt
@assert size(shifted) == (3, 2)

For an encoding operator, transpose the resulting coefficient matrix to put terms in rows. Multishot interpolation accepts a separate offset and ADC-time row for each shot. Its shape contract differs from the current limitations of FindDelay_multishot.

Use an explicit same-type ADC-time vector when dwell times differ. The convenience overload generates times from dt; a Float64 dt with Float32 coefficients can currently fail dispatch. The complete contracts follow.

API ​

Explicit ADC times ​

julia
InterpTrajTime(traj::AbstractArray{T, 2}, dt::Real, delTime::Real, datatime::AbstractVector{T}; intermode::Interpolations.InterpolationType = AkimaMonotonicInterpolation()) where T <: Real

Interpolate field coefficients from equally spaced field samples to requested acquisition times. traj is (nFieldSample,nTerm) and datatime is an ADC time vector of the same element type T; the result is a host matrix (length(datatime),nTerm) converted to T.

Sample j is assigned time (j-1)*dt-delTime. Therefore a positive delTime evaluates the unshifted field at datatime+delTime. Use one consistent time unit; seconds are appropriate when these times multiply a field map in Hz. Outside the shifted measured interval, the result is zero, not extrapolated field dynamics. The default is Akima monotonic interpolation applied to each column. Use a floating-point T, a positive interval and enough field samples for the selected interpolation method. This function does not integrate the coefficients or convert their physical units.

Source: src/Synchronization/InterpTraj.jl

Equal sample intervals ​

julia
InterpTrajTime(traj::AbstractArray{T, 2}, dt::Real, delTime::Real; intermode::Interpolations.InterpolationType = AkimaMonotonicInterpolation()) where T <: Real

Convenience overload that requests the original equally spaced times dt*(0:nFieldSample-1). It retains the zero-extrapolation and positive-delay convention of the explicit-time overload.

The generated time vector inherits the arithmetic type of dt. Currently a Float32 trajectory with Float64 dt can fail dispatch to the explicit-time overload, which requires matching trajectory/time element types. Use dt of the trajectory's floating-point type, or pass an explicit same-type ADC vector. The return shape is the input trajectory shape.

Source: src/Synchronization/InterpTraj.jl

Multiple shots ​

julia
InterpTrajTime(traj::AbstractArray{T, 3}, dt::Real, delTime::AbstractVector{T}, datatime::AbstractArray{T, 2}; intermode::Interpolations.InterpolationType = AkimaMonotonicInterpolation()) where T <: Real

Interpolate each shot independently. traj is (nShot,nFieldSample,nTerm), delTime has one offset per shot, and datatime is (nShot,nADCSample). Offsets and ADC times must share the trajectory element type T; the result is a host array (nShot,nADCSample,nTerm) of that type. Each shot uses the two-dimensional helper, including its sign convention and zero extrapolation. Different field and ADC sample counts are permitted by this interpolation API. This is independent of the more restrictive current multishot delay estimator.

Source: src/Synchronization/InterpTraj.jl

HighOrderMRI.jl documentation · dev · code fa12c44 · docs fa12c44