API
In the following, you find the documentation of all exported functions of the MRFingerprintingRecon.jl package:
MRFingerprintingRecon.FFTNormalOp
MRFingerprintingRecon.NFFTNormalOp
MRFingerprintingRecon.calcCoilMaps
MRFingerprintingRecon.calculateBackProjection
MRFingerprintingRecon.calculateGoldenMeans
MRFingerprintingRecon.grog_calib
MRFingerprintingRecon.grog_gridding!
MRFingerprintingRecon.kooshball
MRFingerprintingRecon.kooshballGA
MRFingerprintingRecon.radial_grog!
MRFingerprintingRecon.traj_2d_radial_goldenratio
MRFingerprintingRecon.traj_cartesian
MRFingerprintingRecon.FFTNormalOp
— MethodFFTNormalOp(img_shape, trj, U; cmaps)
FFTNormalOp(M, U; cmaps)
-FFTNormalOp(Λ; cmaps)
Create normal operator of FFT operator. Differentiate between functions exploiting a pre-calculated kernel basis Λ
and the functions which calculate Λ based on a passed trajectory trj
or mask M
.
Arguments
img_shape::Tuple{Int}
: Image dimensionstraj::Vector{Matrix{Float32}}
: TrajectoryU::Matrix{ComplexF32}
=(1,): Basis coefficients of subspacecmaps::Matrix{ComplexF32}
: Coil sensitivitiesM::Vector{Matrix{Float32}}
: MaskΛ::Array{Complex{T},3}
: Toeplitz kernel basisnum_fft_threads::Int
=round(Int, Threads.nthreads()/size(U, 2))
or `round(Int, Threads.nthreads()/size(Λ, 1)): Number of Threads for FFT
MRFingerprintingRecon.NFFTNormalOp
— MethodNFFTNormalOp(img_shape, trj, U; cmaps, verbose, num_fft_threads)
-NFFTNormalOp(img_shape, Λ, kmask_indcs; cmaps)
Create normal operator of NFFT operator. Differentiate between functions exploiting a pre-calculated Toeplitz kernel basis Λ
and the function which calculates Λ based on a passed trajectory trj
.
Arguments
img_shape::Tuple{Int}
: Image dimensionstraj::AbstractVector{<:AbstractMatrix{T}}
: TrajectoryU::AbstractMatrix{Tc}
: Basis coefficients of subspacecmaps::AbstractVector{Matrix{ComplexF32}}
=[ones(T, img_shape)]
: Coil sensitivitiesΛ::Array{Complex{T},3}
: Toeplitz kernel basiskmask_indcs::Vector{Int}
: Sampling indices of Toeplitz maskverbose::Boolean
=false
: Verbose levelnum_fft_threads::Int
=round(Int, Threads.nthreads()/size(U, 2))
orround(Int, Threads.nthreads()/size(Λ, 1))
: Number of threads for FFT
MRFingerprintingRecon.calcCoilMaps
— MethodcalcCoilMaps(data, trj, img_shape; U, density_compensation, kernel_size, calib_size, eigThresh_1, eigThresh_2, nmaps, verbose)
Estimate coil sensitivity maps using ESPIRiT [1].
Arguments
data::AbstractVector{<:AbstractMatrix{Complex{T}}}
: Complex dataset either as AbstractVector of matrices or single matrix. The optional outer vector defines different time frames that are combined using the subspace defined inU
trj::AbstractVector{<:AbstractMatrix{T}}
: Trajectory with samples corresponding to the dataset either as AbstractVector of matrices or single matrix.img_shape::NTuple{N,Int}
: Shape of image
Keyword Arguments
U::Matrix
= N==3 ? ones(size(data,1)) : I(1): Basis coefficients of subspace (only defined ifdata
andtrj
are vectors of matrices)density_compensation
=:radial_3D
: Values of:radial_3D
,:radial_2D
,:none
, or of typeAbstractVector{<:AbstractVector}
kernel_size
=ntuple(_ -> 6, N)
: Kernel sizecalib_size
=ntuple(_ -> 24, N)
: Size of calibration regioneigThresh_1
=0.01: Threshold of first eigenvalueeigThresh_2
=0.9: Threshold of second eigenvaluenmaps
=1: Number of estimated mapsverbose::Boolean
=false
: Verbosity level
return
cmaps::::Vector{<:Array{Complex{T}}}
: Coil sensitivities as Vector of arrays
References
[1] Uecker, M., Lai, P., Murphy, M.J., Virtue, P., Elad, M., Pauly, J.M., Vasanawala, S.S. and Lustig, M. (2014), ESPIRiT—an eigenvalue approach to autocalibrating parallel MRI: Where SENSE meets GRAPPA. Magn. Reson. Med., 71: 990-1001. https://doi.org/10.1002/mrm.24751
MRFingerprintingRecon.calculateBackProjection
— MethodcalculateBackProjection(data, trj, img_shape; U, density_compensation, verbose)
+FFTNormalOp(Λ; cmaps)
Create normal operator of FFT operator. Differentiate between functions exploiting a pre-calculated kernel basis Λ
and the functions which calculate Λ based on a passed trajectory trj
or mask M
.
Arguments
img_shape::Tuple{Int}
: Image dimensionstraj::Vector{Matrix{Float32}}
: TrajectoryU::Matrix{ComplexF32}
=(1,): Basis coefficients of subspacecmaps::Matrix{ComplexF32}
: Coil sensitivitiesM::Vector{Matrix{Float32}}
: MaskΛ::Array{Complex{T},3}
: Toeplitz kernel basisnum_fft_threads::Int
=round(Int, Threads.nthreads()/size(U, 2))
or `round(Int, Threads.nthreads()/size(Λ, 1)): Number of Threads for FFT
MRFingerprintingRecon.NFFTNormalOp
— MethodNFFTNormalOp(img_shape, trj, U; cmaps, verbose, num_fft_threads)
+NFFTNormalOp(img_shape, Λ, kmask_indcs; cmaps)
Create normal operator of NFFT operator. Differentiate between functions exploiting a pre-calculated Toeplitz kernel basis Λ
and the function which calculates Λ based on a passed trajectory trj
.
Arguments
img_shape::Tuple{Int}
: Image dimensionstraj::AbstractVector{<:AbstractMatrix{T}}
: TrajectoryU::AbstractMatrix{Tc}
: Basis coefficients of subspacecmaps::AbstractVector{Matrix{ComplexF32}}
=[ones(T, img_shape)]
: Coil sensitivitiesΛ::Array{Complex{T},3}
: Toeplitz kernel basiskmask_indcs::Vector{Int}
: Sampling indices of Toeplitz maskverbose::Boolean
=false
: Verbose levelnum_fft_threads::Int
=round(Int, Threads.nthreads()/size(U, 2))
orround(Int, Threads.nthreads()/size(Λ, 1))
: Number of threads for FFT
MRFingerprintingRecon.calcCoilMaps
— MethodcalcCoilMaps(data, trj, img_shape; U, density_compensation, kernel_size, calib_size, eigThresh_1, eigThresh_2, nmaps, verbose)
Estimate coil sensitivity maps using ESPIRiT [1].
Arguments
data::AbstractVector{<:AbstractMatrix{Complex{T}}}
: Complex dataset either as AbstractVector of matrices or single matrix. The optional outer vector defines different time frames that are combined using the subspace defined inU
trj::AbstractVector{<:AbstractMatrix{T}}
: Trajectory with samples corresponding to the dataset either as AbstractVector of matrices or single matrix.img_shape::NTuple{N,Int}
: Shape of image
Keyword Arguments
U::Matrix
= N==3 ? ones(size(data,1)) : I(1): Basis coefficients of subspace (only defined ifdata
andtrj
are vectors of matrices)density_compensation
=:radial_3D
: Values of:radial_3D
,:radial_2D
,:none
, or of typeAbstractVector{<:AbstractVector}
kernel_size
=ntuple(_ -> 6, N)
: Kernel sizecalib_size
=ntuple(_ -> 24, N)
: Size of calibration regioneigThresh_1
=0.01: Threshold of first eigenvalueeigThresh_2
=0.9: Threshold of second eigenvaluenmaps
=1: Number of estimated mapsverbose::Boolean
=false
: Verbosity level
return
cmaps::::Vector{<:Array{Complex{T}}}
: Coil sensitivities as Vector of arrays
References
[1] Uecker, M., Lai, P., Murphy, M.J., Virtue, P., Elad, M., Pauly, J.M., Vasanawala, S.S. and Lustig, M. (2014), ESPIRiT—an eigenvalue approach to autocalibrating parallel MRI: Where SENSE meets GRAPPA. Magn. Reson. Med., 71: 990-1001. https://doi.org/10.1002/mrm.24751
MRFingerprintingRecon.calculateBackProjection
— MethodcalculateBackProjection(data, trj, img_shape; U, density_compensation, verbose)
calculateBackProjection(data, trj, cmaps::AbstractVector{<:AbstractArray{cT,N}}; U, density_compensation, verbose)
calculateBackProjection(data, trj, cmaps_img_shape; U, density_compensation, verbose)
-calculateBackProjection(data, trj, cmaps; U)
Calculate (filtered) backprojection
Arguments
data <: Union{AbstractVector{<:AbstractMatrix{cT}},AbstractMatrix{cT}}
: Complex dataset either as AbstractVector of matrices or single matrix. The optional outer matrix defines different time frames that are reconstruced in the subspace defined in U.trj <: Union{:AbstractVector{<:AbstractMatrix{T}},AbstractMatrix{T}}
: Trajectory with samples corresponding to the dataset either as AbstractVector of matrices or single matrix.img_shape::NTuple{N,Int}
: Shape of image
Optional Keyword Arguments
cmaps::::AbstractVector{<:AbstractArray{T}}
: Coil sensitivities as AbstractVector of arrayscmaps_img_shape
: Either equalimg_shape
orcmaps
U::Matrix
= I(length(data)) or = I(1): Basis coefficients of subspace (only defined if data and trj have different timeframes)density_compensation
=:none
: Values of:radial_3D
,:radial_2D
,:none
, or of typeAbstractVector{<:AbstractVector}
verbose::Boolean
=false
: Verbosity level
Notes
- The type of the elements of the trajectory define if a gridded backprojection (eltype(trj[1]) or eltype(trj) <: Int) or a non-uniform (else) is performed.
MRFingerprintingRecon.calculateGoldenMeans
— MethodcalculateGoldenMeans()
Function to calculate 3D golden means [1].
References
[1] Chan, R.W., Ramsay, E.A., Cunningham, C.H. and Plewes, D.B. (2009), Temporal stability of adaptive 3D radial MRI using multidimensional golden means. Magn. Reson. Med., 61: 354-363. https://doi.org/10.1002/mrm.21837
MRFingerprintingRecon.grog_calib
— Methodgrog_calib(data, trj, Nr)
Perform GROG kernel calibration based on whole radial trajectory and passed data. Calibration follows the work on self-calibrating radial GROG (https://doi.org/10.1002/mrm.21565).
Arguments
data::AbstractVector{<:AbstractMatrix{cT}}
: Complex dataset passed as AbstractVector of matricestrj::Vector{Matrix{Float32}}
: Trajectory with samples corresponding to the dataset passed as AbstractVector of matrices with Float32 entriesNr::Int
: Number of samples per read out
MRFingerprintingRecon.grog_gridding!
— Methodgrog_gridding!(data, trj, lnG, Nr, img_shape)
Perform gridding of data based on pre-calculated GROG kernel.
Arguments
data::AbstractVector{<:AbstractMatrix{cT}}
: Complex dataset passed as AbstractVector of matricestrj::Vector{Matrix{Float32}}
: Trajectory with samples corresponding to the dataset passed as AbstractVector of matrices with Float32 entrieslnG::Vector{Matrix{Float32}}
: Natural logarithm of GROG kernel in all dimensionsNr::Int
: Number of samples per read outimg_shape::Tuple{Int}
: Image dimensionstrj::Vector{Matrix{Int32}}
: Trajectory
Dimensions:
data
: [timesteps][samples, spokes, coils, repetitions of sampling pattern]trj
: [timesteps][dims, samples, repetitions]lnG
: [dims][Ncoils, Ncoils]
MRFingerprintingRecon.kooshball
— Methodkooshball(Nr, theta, phi; thetaRot, phiRot, delay)
Function to calculate kooshball trajectory.
Arguments
Nr::Int
: Number of read out samplestheta::Array{Float,2}
: Array with dimensions:Ncyc, Nt
defining the anglestheta
for each cycle and timestep.phi::Array{Float,2}
: Array with dimensions:Ncyc, Nt
defining the anglesphi
for each cycle and timestep.thetaRot::Float
= 0: Fixed rotation angle along thetaphiRot::Float
= 0: Fixed rotation angle along phidelay::Tuple{Float, Float, Float}
=(0, 0, 0)
: Gradient delays in (HF, AP, LR)
MRFingerprintingRecon.kooshballGA
— MethodkooshballGA(Nr, Ncyc, Nt; thetaRot, phiRot, delay)
Function to calculate golden means [1] based kooshball trajectory.
Arguments
Nr::Int
: Number of read out samplesNcyc::Int
: Number of cyclesNt::Int
: Number of time steps in the trajectorythetaRot::Float
= 0: Fixed rotation angle along thetaphiRot::Float
= 0: Fixed rotation angle along phidelay::Tuple{Float, Float, Float}
=(0, 0, 0)
: Gradient delays in (HF, AP, LR)
References
[1] Chan, R.W., Ramsay, E.A., Cunningham, C.H. and Plewes, D.B. (2009), Temporal stability of adaptive 3D radial MRI using multidimensional golden means. Magn. Reson. Med., 61: 354-363. https://doi.org/10.1002/mrm.21837
MRFingerprintingRecon.radial_grog!
— Methodradial_grog!(data, trj, Nr, img_shape)
Perform GROG kernel calibration and gridding [1] of data in-place. The trajectory is returned with integer values.
Arguments
data::AbstractVector{<:AbstractMatrix{cT}}
: Complex dataset passed as AbstractVector of matricestrj::Vector{Matrix{Float32}}
: Trajectory with samples corresponding to the dataset passed as AbstractVector of matrices with Float32 entriesNr::Int
: Number of samples per read outimg_shape::Tuple{Int}
: Image dimensions
return
trj::Vector{Matrix{Int32}}
: Trajectory
References
[1] Seiberlich, N., Breuer, F., Blaimer, M., Jakob, P. and Griswold, M. (2008), Self-calibrating GRAPPA operator gridding for radial and spiral trajectories. Magn. Reson. Med., 59: 930-935. https://doi.org/10.1002/mrm.21565
MRFingerprintingRecon.traj_2d_radial_goldenratio
— Methodtraj_2d_radial_goldenratio(Nr, Ncyc, Nt; thetaRot, phiRot, delay, N)
Function to calculate 2D golden ratio based trajectory [1]. By modifying N
also tiny golden angles [2] are supported.
Arguments
Nr::Int
: Number of read out samplesNcyc::Int
: Number of cyclesNt::Int
: Number of time steps in the trajectorythetaRot::Float
= 0: Fixed rotation angle along thetaphiRot::Float
= 0: Fixed rotation angle along phidelay::Tuple{Float, Float, Float}
=(0, 0, 0)
: Gradient delays in (HF, AP, LR)N::Int
= 1: Number of tiny golden angle
References
[1] Winkelmann S, Schaeffter T, Koehler T, Eggers H, Doessel O. An optimal radial profile order based on the Golden Ratio for time-resolved MRI. IEEE TMI 26:68–76 (2007) [2] Wundrak S, Paul J, Ulrici J, Hell E, Geibel MA, Bernhardt P, Rottbauer W, Rasche V. Golden ratio sparse MRI using tiny golden angles. Magn Reson Med 75:2372-2378 (2016)
MRFingerprintingRecon.traj_cartesian
— Methodtraj_cartesian(Nx, Ny, Nz, Nt; samplingRate_units = true, T = Float32)
Function to calculate a 2D cartesian trajectory in units of sampling rate ∈ {x | -N/2+1 ≤ x ≤ N/2 and x ∈ Z}. With samplingRate_units = false
the ouput is relative with samples ∈ [-1/2:1/2].
Arguments
Nx::Int
: Number of frequency encoded samples per read outNy::Int
: Number of phase encoding linesNz::Int
: Number of phase encoding lines (third dimension)Nt::Int
: Number of times the sampling pattern is repeatedsamplingRate_units::Boolean
=true
: Parameter setting the output units to sampling rateT::Type
=Float32
: Type defining the output units of the trajectory