API

This page contains documentation of the public API of MRIReco. In the Julia REPL one can access this documentation by entering the help mode with ? and then writing the function for which the documentation should be shown.

Operators

Operators are implemented as subtypes of AbstractLinearOperator, which is defined in the package LinearOperators.jl. Such operators must provide a function implementing the product and a function implementing the product with the adjoint. Furthermore, the number of rows and columns of the operator must be specified.

MRIReco.encodingOps2d_simpleFunction
encodingOps2d_simple(acqData::AcquisitionData, shape::NTuple{2,Int64}
                          ; slice=1
                          , correctionMap::Array{ComplexF64}=ComplexF64[]
                          , method::String="nfft")

generates an Array of LinearOperators which describe 2d signal encoding of the individual contrasts in an MRI acquisition (for a given slice).

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • shape::NTuple{2,Int64} - size of image to be encoded/reconstructed
  • slice=1 - slice to be encoded/reconstructed
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
MRIReco.encodingOps3d_simpleFunction
encodingOps3d_simple(acqData::AcquisitionData, shape::NTuple{2,Int64}
                          ; correctionMap::Array{ComplexF64}=ComplexF64[]
                          , method::String="nfft")

generates an Array of LinearOperators which describe 3d signal encoding of the individual contrasts&coils in an MRI acquisition (for a given slice). Arguments are the same as in the 2d case, with the exception that shape is of type NTuple{3,Int64} and the considered slice is not specified.

MRIReco.encodingOps2d_parallelFunction
encodingOps2d_parallel(acqData::AcquisitionData, shape::NTuple{2,Int64}
                          , senseMaps::Array{ComplexF64}
                          ; slice=1
                          , correctionMap::Array{ComplexF64}=ComplexF64[]
                          , method::String="nfft")

generates an Array of LinearOperators which describe 2d signal encoding of the individual contrasts in an MRI acquisition (for a given slice). The different coils are taken into account in terms of their sensitivities

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • shape::NTuple{2,Int64} - size of image to be encoded/reconstructed
  • senseMaps::Array{ComplexF64} - coil sensitivities
  • slice=1 - slice to be encoded/reconstructed
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
MRIReco.encodingOps3d_parallelFunction
encodingOps3d_parallel(acqData::AcquisitionData, shape::NTuple{2,Int64}
                          , senseMaps::Array{ComplexF64}
                          ; correctionMap::Array{ComplexF64}=ComplexF64[]
                          , method::String="nfft")

generates an Array of LinearOperators which describe 3d signal encoding of the individual contrasts in an MRI acquisition (for a given slice). The different coils are taken into account in terms of their sensitivities Arguments are the same as in the 2d case, with the exception that shape is of type NTuple{3,Int64} and the considered slice is not specified.

MRIReco.encodingOp2d_multiEchoFunction
encodingOp2d_multiEcho(acqData::AcquisitionData, shape::NTuple{2,Int64}
                            ; slice::Int64=1
                            , correctionMap::Array{ComplexF64}=ComplexF64[]
                            , method::String="nfft")

generates a LinearOperator which describe combined 2d signal encoding of all the contrasts in an MRI acquisition (for a given slice).

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • shape::NTuple{2,Int64} - size of image to be encoded/reconstructed
  • slice=1 - slice to be encoded/reconstructed
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
MRIReco.encodingOp3d_multiEchoFunction
encodingOp3d_multiEcho(acqData::AcquisitionData, shape::NTuple{2,Int64}
                            ; correctionMap::Array{ComplexF64}=ComplexF64[])

generates a LinearOperator which describe combined 3d signal encoding of all the contrasts in an MRI acquisition (for a given slice). Arguments are the same as in the 2d case, with the exception that shape is of type NTuple{3,Int64} and the considered slice is not specified.

MRIReco.encodingOp2d_multiEcho_parallelFunction
encodingOp2d_multiEcho_parallel(acqData::AcquisitionData, shape::NTuple{2,Int64}
                                      , senseMaps::Array{ComplexF64}
                                      ; slice=1
                                      , correctionMap::Array{ComplexF64}=ComplexF64[]
                                      , method::String="nfft")

generates a LinearOperator which describe combined 3d signal encoding of all the contrasts in an MRI acquisition (for a given slice). The different coils are taken into account in terms of their sensitivities

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • shape::NTuple{2,Int64} - size of image to be encoded/reconstructed
  • senseMaps::Array{ComplexF64} - coil sensitivities
  • slice=1 - slice to be encoded/reconstructed
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
MRIReco.encodingOp3d_multiEcho_parallelFunction
encodingOp3d_multiEcho_parallel(acqData::AcquisitionData, shape::NTuple{2,Int64}
                                      , senseMaps::Array{ComplexF64}
                                      ; correctionMap::Array{ComplexF64}=ComplexF64[]
                                      , method::String="nfft")

generates a LinearOperator which describe combined 3d signal encoding of all the contrasts in an MRI acquisition (for a given slice). The different coils are taken into account in terms of their sensitivities Arguments are the same as in the 2d case, with the exception that shape is of type NTuple{3,Int64} and the considered slice is not specified.

MRIReco.fourierEncodingOp2dFunction

return 2d Fourier encoding operator (either Explicit or NFFT)

  • opname : "explicit" or "fast"
  • slice : slice to which the operator will be applied

echoImage : calculate signal evolution relative to the echo time

MRIReco.fourierEncodingOp3dFunction

return 3d Fourier encoding operator (either Explicit, FFT or NFFT) opname : "explicit", "fft" or "fast" echoImage : calculate signal evolution relative to the echo time

MRIReco.ExplicitOpMethod
ExplicitOp(shape::NTuple{D,Int64}, tr::Trajectory, correctionmap::Array{ComplexF64,D}
        ; echoImage::Bool=false, kargs...) where D

generates a ExplicitOp which explicitely evaluates the MRI Fourier signal encoding operator.

Arguments:

  • shape::NTuple{D,Int64} - size of image to encode/reconstruct
  • tr::Trajectory - Trajectory with the kspace nodes to sample
  • correctionmap::Array{ComplexF64,D} - fieldmap for the correction of off-resonance effects
  • echoImage::Bool=false - if true sampling times will only be considered relative to the echo time this results in complex valued image even for real-valued input.
  • kargs - additional keyword arguments
Missing docstring.

Missing docstring for RegularizedLeastSquares.FFTOp(T::Type, shape::Tuple, shift=true). Check Documenter's build log for details.

MRIReco.NFFTOpMethod
NFFTOp(shape::Tuple, tr::Trajectory; nodes=nothing, kargs...)

generates a NFFTOp which evaluates the MRI Fourier signal encoding operator using the NFFT.

Arguments:

  • shape::NTuple{D,Int64} - size of image to encode/reconstruct
  • tr::Trajectory - Trajectory with the kspace nodes to sample
  • (nodes=nothing) - Array containg the trajectory nodes (redundant)
  • (kargs) - additional keyword arguments
MRIReco.FieldmapNFFTOpMethod
FieldmapNFFTOp(shape::NTuple{D,Int64}, tr::Trajectory,
                    correctionmap::Array{ComplexF64,D};
                    method::String="nfft",
                    echoImage::Bool=true,
                    alpha::Float64=1.75,
                    m::Float64=3.0,
                    K=20,
                    kargs...) where D

generates a FieldmapNFFTOp which evaluates the MRI Fourier signal encoding operator, including B0-inhomogeneities using time-segmented NFFTs.

Arguments:

  • shape::NTuple{D,Int64} - size of image to encode/reconstruct
  • tr::Trajectory - Trajectory with the kspace nodes to sample
  • correctionmap::Array{ComplexF64,D} - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
  • (echoImage::Bool=false) - if true sampling times will only be considered relative to the echo time this results in complex valued image even for real-valued input.
  • (alpha::Float64=1.75) - oversampling factor for interpolation
  • (m::Float64=3.0) - truncation size of interpolation kernel
  • (K=20) - number of translates for LeastSquares approaches (not NFFT-approach) to time-segmentation
  • (kargs) - additional keyword arguments
MRIReco.SamplingOpFunction
SamplingOp(pattern::Array{Int}, shape::Tuple)

buildsa LinearOperator which only returns the vector elements at positions indicated by pattern.

Arguents

  • pattern::Array{Int} - indices to sample
  • shape::Tuple - size of the array to sample
MRIReco.SensitivityOpFunction
SensitivityOp(sensMaps::Matrix{ComplexF64}, numEchoes::Int=1)

builds a LinearOperator which performs multiplication of a given image with the coil sensitivities specified in sensMaps

Arguments

  • sensMaps::Matrix{ComplexF64} - sensitivity maps ( 1. dim -> voxels, 2. dim-> coils)
  • numEchoes - number of contrasts to which the opetaor will be applied
SensitivityOp(sensMaps::Array{T,4}, numEchoes::Int=1) where T

builds a LinearOperator which performs multiplication of a given image with the coil sensitivities specified in sensMaps

Arguments

  • sensMaps::Array{T,4} - sensitivity maps ( 1.-3. dim -> voxels, 4. dim-> coils)
  • numEchoes - number of contrasts to which the opetaor will be applied
MRIReco.SparseOpFunction
SparseOp(name::AbstractString, shape::NTuple{N,Int64}; kargs...) where N

generates the sparsifying transform (<: AbstractLinearOperator) given its name.

Arguments

  • name::AbstractString - name of the sparsifying transform
  • shape::NTuple{N,Int64} - size of the Array to be transformed
  • (kargs) - additional keyword arguments
Missing docstring.

Missing docstring for MRIReco.RegularizedLeastSquares.WeightingOp. Check Documenter's build log for details.

Datatypes

MRIReco.AcquisitionDataType

struct describing MRI acquisition data.

Fields

  • sequenceInfo::Dict{Symbol,Any} - additional information on the pulse sequence
  • traj::Vector{Trajectory} - trajectories for each echo/contrast
  • kdata::Array{Matrix{ComplexF64},3} - each matrix contains data for one trajectory (1. dim k-space nodes, 2. dim coils) the outer dims describe: 1. dim echoes, 2. dim slices, 3. dim repetitions
  • subsampleIndices::Vector{Array{Int64}} - indices sampled for each echo/contrast
  • encodingSize::Vector{Int64} - size of the underlying image matrix
  • fov::Vector{Float64} - field of view in m
MRIReco.AcquisitionDataMethod
AcquisitionData(tr::T,kdata::Array{Matrix{ComplexF64},3}; seqInfo=Dict{Symbol,Any}()
                    , idx=nothing, encodingSize=Int64[0,0,0], fov=Float64[0,0,0]
                    , kargs...) where T <: Union{Trajectory,Vector{Trajectory}}

constructor for AcquisitionData

Arguments

  • tr <: Union{Trajectory,Vector{Trajectory}} - trajectories
  • kdata::Array{Matrix{ComplexF64},3} - k-space data

the other fields of AcquisitionData can be passed as keyword arguments.

MRIReco.trajectoryFunction
trajectory(acqData::AcquisitionData,i::Int64=1)

returns the i-th trajectory contained in acqData.

MRIReco.numContrastsMethod
numContrasts(acqData::AcquisitionData)

returns the number of contrasts/echoes in acqData

MRIReco.numChannelsFunction
numChannels(acqData::AcquisitionData)

returns the number of channels/coils in acqData

numChannels(f::RawAcquisitionData)

returns the number of channels in a RawAcquisitionData object.

MRIReco.numSlicesFunction

numSlices(tr::Trajectory) returns the number of slices of a trajectory

numSlices(acqData::AcquisitionData)

returns the number of slices in acqData

MRIReco.numRepititionsFunction
numRepititions(acqData::AcquisitionData)

returns the number of repetitions in acqData

MRIReco.kDataFunction
kData(acqData::AcquisitionData, echo::Int64=1, coil::Int64=1, slice::Int64=1;rep::Int64=1)

returns the k-space contained in acqData for given echo, coil, slice and rep(etition).

MRIReco.multiEchoDataFunction
multiEchoData(acqData::AcquisitionData, coil::Int64, slice::Int64;rep::Int64=1)

returns the k-space contained in acqData for all echoes and given coil, slice and rep(etition).

MRIReco.multiCoilDataFunction
multiCoilData(acqData::AcquisitionData, echo::Int64, slice::Int64;rep::Int64=1)

returns the k-space contained in acqData for all coils and given echo, slice and rep(etition).

MRIReco.multiCoilMultiEchoDataFunction
multiCoilMultiEchoData(acqData::AcquisitionData, echo::Int64, slice::Int64;rep::Int64=1)

returns the k-space contained in acqData for all coils, echoes and given slice and rep(etition).

MRIReco.profileDataFunction
profileData(acqData::AcquisitionData, echo::Int64, slice::Int64, rep::Int, prof_tr::Int)

returns the profile-data prof_tr contained in acqData for given echo, coil, slice and rep(etition).

MRIReco.samplingDensityFunction
samplingDensity(acqData::AcquisitionData,shape::Tuple)

returns the sampling density for all trajectories contained in acqData.

MRIReco.changeEncodingSize2DFunction
changeEncodingSize2D(acqData::AcquisitionData,newEncodingSize::Vector{Int64})

changes the encoding size of 2d encoded acqData to newEncodingSize. Returns a new AcquisitionData object.

MRIReco.convert3dTo2dFunction
convert3dTo2d(acqData::AcquisitionData)

convert the 3d encoded AcquisitionData acqData to the equivalent 2d AcquisitionData.

MRIReco.RawAcquisitionDataType

RawAcquisitionData object.

Fields

  • params::Dict{String, Any} - Dict containing the information of the XML header in ISMRMRD
  • profiles::Vector{Profile} - Vector containing all the profiles of the acquisition
MRIReco.trajectoryMethod

trajectory(f::RawAcquisitionData; slice::Int=1, contrast::Int=1)

returns the Trajectory for given slice and contrast of a RawAcquisitionData object.

MRIReco.rawdataMethod
rawdata(f::RawAcquisitionData)

returns the rawdata contained RawAcquisitionData object. The output is an Array{Matrix{ComplexF64},3}, which can be stored in a AcquisitionData object.

MRIReco.AcquisitionDataMethod
AcquisitionData(f::RawAcquisitionData)

converts RawAcquisitionData into the equivalent AcquisitionData object.

MRIReco.RawAcquisitionDataType
RawAcquisitionData(f::ISMRMRDFile, dataset="dataset")

reads the ISMRMRDFile f and stores the result in a RawAcquisitionDataObject

MRIReco.AcquisitionDataType
AcquisitionData(f::ISMRMRDFile, dataset="dataset")

reads the ISMRMRDFile f and stores the result in an AcquisitionDataObject

Trajectories

MRIReco.TrajectoryType

struct describing a trajectory

Fields

  • name::String - name of the trajectory
  • nodes::Matrix{Float64} - sampling locations in k-space. (1.dim <-> dimensions of k-space, 2. dim <-> sampling points)
  • times::Vector{Float64} - sampling times in s
  • TE::Float64 - echo time in s
  • AQ::Float64` - readout duration in s (per profile)
  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • numSlices::Int64 - number of slices (for 3d trajectories)
  • cartesian::Bool - true if sampling points lie on a cartesian grid
  • circular::Bool - true if kspace is covered in a circular domain
MRIReco.trajectoryMethod
trajectory(trajName::AbstractString, numProfiles::Int, numSamplingPerProfile::Int; numSlices::Int64=1, TE::Float64=0.0, AQ::Float64=1.e-3, kargs...)

is a factory method to construct a trajectory from its name

Arguments

  • name::String - name of the trajectory
  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (numSlices::Int64=1) - number of slices (for 3d trajectories)
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • kargs... - addional keyword arguments
Base.stringMethod

string(tr::Trajectory) returns the name of a trajectory

MRIReco.echoTimeMethod

echoTime(tr::Trajectory) returns the echo time of a trajectory

MRIReco.acqTimePerProfileMethod

acqTimePerProfile(tr::Trajectory) returns the acquisition time per profile of a trajectory

MRIReco.numSlicesMethod

numSlices(tr::Trajectory) returns the number of slices of a trajectory

MRIReco.isCircularMethod

isCircular(tr::Trajectory) returns whether the trajectory has circular k-space coverage

MRIReco.isCartesianMethod

isCartesian(tr::Trajectory) returns whether the trajectory nodes lie on a cartesian grid

MRIReco.dimsMethod

dims(tr::Trajectory) returns the number of dimensions of a trajectory

MRIReco.kspaceNodesMethod

kspaceNodes(tr::Trajectory) returns the kspace sampling points of a trajectory

MRIReco.readoutTimesMethod

readoutTimes(tr::Trajectory) returns the readoutTimes for the sampling points of a trajectory

MRIReco.CartesianTrajectoryFunction
CartesianTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , kmin=(-0.5,-0.5)
              , kmax=(0.5,0.5)
              , kargs...)

returns a 2d cartesian trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (kmin=(-0.5,-0.5)) - minimum values of the covered k-space (for partial Fourier imaging)
  • (kmax=(-0.5,-0.5)) - maximum values of the covered k-space (for partial Fourier imaging)
MRIReco.EPITrajectoryFunction
EPITrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , EPI_factor::Int64=1
              , profileOffset= :equispaced
              , kargs...)

returns a 2d cartesian trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (EPI_factor::Int64=1) - EPI factor, e.g. how many profiles to acquire per shot
  • (profileOffset= :equispaced) - equispaced or random ordering of the shots
MRIReco.OneLine2dTrajectoryFunction
OneLine2dTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , angle::Float64=0.0
              , kargs...)

returns a trajectory consisting of one arbitrarily rotated profile.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (angle::Float64=0.0) - angle of the profile (with respect to the x-axis) in radians
MRIReco.RadialTrajectoryFunction
RadialTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , angleOffset= :equispaced
              , kargs...)

returns a 2d radial trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (angleOffset= :equispaced) - spacing of profile angles (:equispaced sampling, :golden angle sampling or :random sampling)
MRIReco.SpiralTrajectoryFunction
SpiralTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , windings::Real= 6.25
              , angleOffset= :equispaced
              , kargs...)

returns a 2d spiral trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (windings::Real= 6.25) - number of windings of the spiral profiles
  • (angleOffset= :equispaced) - spacing of profile angles (:equispaced sampling, :golden angle sampling or :random sampling)
MRIReco.SpiralTrajectoryVarDensFunction
SpiralTrajectoryVarDens(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , windings::Real= 6.25
              , alpha=2.0
              , angleOffset= :equispaced
              , kargs...)

returns a 2d spiral trajectory with variable density

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (windings::Real= 6.25) - number of windings of the spiral profiles
  • (alpha=2.0) - exponent describing the evolution of the magnitude of the sampling points along the profiles
  • (angleOffset= :equispaced) - spacing of profile angles (:equispaced sampling, :golden angle sampling or :random sampling)
MRIReco.CartesianTrajectory3DFunction
CartesianTrajectory3D(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , numSlices=1
              , kargs...)

returns a 3d cartesian trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (numSlices=1) - number of slices
MRIReco.KooshballTrajectoryFunction
KooshballTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , kargs...)

returns a 3d kooshball trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
MRIReco.StackOfStarsTrajectoryFunction
StackOfStarsTrajectory(numProfiles, numSamplingPerProfile
              ; TE::Float64=0.0
              , AQ::Float64=1.e-3
              , numSlices=1
              , angleOffset= :equispaced
              , kargs...)

returns a 2d radial trajectory.

Arguments

  • numProfiles::Int64 - number of profiles
  • numSamplingPerProfile::Int64 - number of sampling points per profile
  • (TE::Float64=0.0) - echo time in s
  • (AQ::Float64=1.e-3) - readout duration in s (per profile)
  • (numSlices=1) - number of slices
  • (angleOffset= :equispaced) - spacing of profile angles (:equispaced sampling, :golden angle sampling or :random sampling)

Sequences

MRIReco.MESequenceType

General Multi-Echo sequence with variable flip angles and TR.

The phase of the excitation pulse has a phase of -90° in order to fulfill CPMG conditions.

For simplicity instantaneous pulses are assumed.

echoes apperat at times Techo, 2*Techo,..., numContrasts*T_echo after the excitation pulse

Fields

  • excitationAngle::Float64 - flip angle of the excitation pulse
  • refocusingAngles :: Vector{Float64} - flip angles of the refocusing pulses
  • T_rf::Vector{Float64} - times of the refocusing pulses relative to the excitation pulse
  • T_echo:: Vector{Float64} - echo times relative to the excitation pulse
MRIReco.numContrastsMethod
numContrasts(seq::MESequence)

returns the number of echoes of an ME Sequence

MRIReco.echoTimesMethod
echoTimes(seq::MESequence)

returns the echo times of an ME Sequence

MRIReco.flipAnglesMethod
flipAngles(seq::MESequence)

returns the refocusing flip angles of an ME Sequence

MRIReco.echoAmplitudesFunction
echoAmplitudes(seq::MESequence, R1::Float64, R2::Float64, numStates=nothing)

calculates echo amplitudes for a given MESequence and given relaxation Rates R1, R2. Calculations are performed using the extended phase graph method. For simplicity instantaneous pulses are assumed. If numStates=nothing all dephasing states will be taken into account

Arguments

  • seq::MESequence - pulse sequence
  • R1::Float64 - R1 value to use (1/T1)
  • R2::Float64 - R2 value to use (1/T2)
  • numStates=nothing - number of dephasing states to consider
MRIReco.epgAmplitudesFunction
epgAmplitudes(seq::MESequence, R1::Float64, R2::Float64, numStates=nothing)

calculates EPG amplitudes after each pulse of a given MESequence with the given relaxation Rates R1, R2. Calculations are performed using the extended phase graph method. For simplicity instantaneous pulses are assumed. If numStates=nothing all dephasing states will be taken into account

Arguments

  • seq::MESequence - pulse sequence
  • R1::Float64 - R1 value to use (1/T1)
  • R2::Float64 - R2 value to use (1/T2)
  • numStates=nothing - number of dephasing states to consider
MRIReco.epgRotationFunction
epgRotation(alpha::Float64, F::Vector{T}, Z::Vector{T}; statesConsidered=nothing, phi::Float64=0.0)

applies Bloch-rotation (<=> RF pulse) to a set of EPG states.

Arguments

  • alpha::Float64 - flip angle of the RF pulse
  • F::Vector{T} - transverse dephasing stats
  • Z::Vector{T} - longitudinal dephasing stats
  • statesConsidered=nothing - number of dephasing states to consider (nothing means all states are taken into account)
  • phi::Float64=0.0 - phase of the RF pulse
MRIReco.epgRelaxationFunction
epgRelaxation( R1::Float64, R2::Float64, t::Float64, F::Vector{T}, Z::Vector{T}) where T

applies relaxation matrices to a set of EPG states.

Arguments

  • R1::Float64 - R1
  • R2::Float64 - R2
  • t::Float64 - length of time interval in s
  • F::Vector{T} - transverse dephasing stats
  • Z::Vector{T} - longitudinal dephasing stats
MRIReco.epgDephasingFunction
epgDephasing(F::Vector{T}, n=1) where T = circshift(F[:],n)

shifts the transverse dephasing states F corresponding to n dephasing-cycles.

MRIReco.rfRotationFunction
rfRotation(alpha, phi=0.)

returns the rotation matrix for a pulse with flip angle alpha and phase phi.

Sampling

MRIReco.sampleFunction
sample(shape::NTuple{N,Int64}, redFac::Float64, patFunc::String; kargs...)

generates a Vector{Int64} of indices to sample an Array of of size shape with a reduction factor redFac.

Arguments

  • shape::NTuple{N,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
  • patFunc::String - name of the sampling function ("random, "regular", "lines", "poisson" or "vdPoisson")
MRIReco.sample_kspaceMethod
sample_kspace(data::AbstractArray, redFac::Float64, patFunc::String; kargs...)

subsamples the Array data with a reduction factor redFac and returns both the subsampled Array (as a vector) and the sampled indices (as a vector)

Arguments

  • data::AbstractArray - array to be sampled
  • redFac::Float64 - subsampling factor
  • patFunc::String - name of the sampling function ("random, "regular", "lines", "poisson" or "vdPoisson")
  • kargs... - addional keyword arguments
MRIReco.sample_kspaceMethod
sample_kspace(acqData::AcquisitionData,redFac::Float64,
            patFunc::AbstractString; rand=true, profiles=true,
            seed = 1234, kargs...)

subsamples the data in acqData with reduction factor redFac and returns a new AcquisitionData object.

Arguments

  • acqData::AcquisitionDatay - AcquisitionData to be sampled
  • redFac::Float64 - subsampling factor
  • patFunc::String - name of the sampling function ("random, "regular", "lines", "poisson" or "vdPoisson")
  • (rand=true) - use different patterns for the different contrasts
  • (profiles=true) - sample complete profiles
  • (seed=1234) - seed for the random number generator
  • kargs... - addional keyword arguments
MRIReco.sample_regularMethod
sample_regular(shape::Tuple{Int64,Int64},redFac::Float64;kargs...)

generates a regular sampling pattern for an Array of size shape with a subsampling factor redFac.

Arguments

  • shape::NTuple{N,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
MRIReco.sample_randomMethod
sample_random(shape::Tuple{Int64,Int64},redFac::Float64;calsize::Int64=0,kargs...)

generates a random sampling pattern for an Array of size shape with a subsampling factor redFac.

Arguments

  • shape::NTuple{N,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
  • (calsize::Int64=0) - size of the fully sampled calibration area
MRIReco.sample_poissondiskMethod
sample_poissondisk(shape::Tuple{Int64,Int64},redFac::Float64;calsize::Int64=0, seed::Int64=1234,kargs...)

generates a Poisson disk sampling pattern for an Array of size shape with a subsampling factor redFac.

Arguments

  • shape::NTuple{2,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
  • (calsize::Int64=0) - size of the fully sampled calibration area
  • (seed=1234) - seed for the random number generator
MRIReco.sample_vdpoissonMethod
sample_vdpoisson(shape::Tuple{Int64,Int64},redFac::Float64; seed::Int64=1234,kargs...)

generates a variable density Poisson disk sampling pattern for an Array of size shape with a subsampling factor redFac.

Arguments

  • shape::NTuple{2,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
  • (seed=1234) - seed for the random number generator
MRIReco.sample_linesMethod
sample_lines(shape::Tuple{Int64,Int64},redFac::Float64;sampleFunc="random",kargs...)

generates a pattern to sample complete lines of an Array of size shape with a subsampling factor redFac.

Arguments

  • shape::NTuple{N,Int64} - size of the Array to be sampled
  • redFac::Float64 - subsampling factor
  • sampleFunc="random" - name of the sampling function ("random, "regular", "lines", "poisson" or "vdPoisson")
  • kargs... - addional keyword arguments
MRIReco.calculateIncoherenceFunction
calculateIncoherence(acqData::AcquisitionData, recoParams::Dict, slice=1)

calculates the incoherence of the sampling pattern contained in acqData

Arguments

  • acqData::AcquisitionData - AcquisitionData containing the sampling pattern
  • recoParams::Dict - Dict containing reconstruction parameters
  • (slice=1) - slice for which to calculate the incoherence

Simulation

MRIReco.simulationMethod
simulation(image::Array{T,3}, simParams::Dict) where T<:Union{ComplexF64,Float64}

Simulate MRI raw data from given image data. All simulation parameters are passed to the function in the form of a dictionary.

MRIReco.simulationMethod
simulation(image::Array{T,3}, simParams::Dict, filename::String) where T<:Union{ComplexF64,Float64}

Performs the same simulation as simulation(image, simParams) and saves the result in a file with name filename

MRIReco.simulationMethod
simulation(image::Array{T,2}, simParams::Dict) where T<:Union{ComplexF64,Float64}

Simulate MRI raw data from given image data. All simulation parameters are passed to the function in the form of a dictionary.

MRIReco.simulationFunction
simulation(tr::Trajectory, image::Array{ComplexF64}, correctionMap = []; opName="fast"
          , senseMaps=[], verbose=true, kargs...)

Transforms a given image to k-space Domain. Dispatches whether the trajectory is 2d or 3d The Fourier integrals can be evaluated exactly or using NFFT Returns the demodulated signal.

...

Arguments

  • tr::Trajectory - three-dimensional Trajectory
  • image::Array{ComplexF64,3} - image to be transformed
  • (correctionMap=[]) - sum of the field offresonance (imaginary) map and relaxation map (real)
  • (`opName="fast") - name of operator to use ("explicit" or "fast")
  • (sensmaps=[]) - array of coil sensitivities
  • (verbose=true) - prints the progress if true
  • kargs... - addional keyword arguments

...

MRIReco.simulationMethod
simulation(seq::AbstractSequence, tr::Vector{Trajectory}, image::Array{ComplexF64,3}
                ; opName="fast", r1map=[], r2map=[], fmap=[], senseMaps=[]
                , verbose=true, kargs...)

Simulate k-space data for all echoes of a pulse sequence. The echo intensities are simulated using the EPG formalism The Fourier integrals can be evaluated exactly or using NFFT

...

Arguments

  • seq::AbstractSequence - pulse sequence
  • tr::Vector{Trajectory} - trajectories for all contrasts
  • image::Array{ComplexF64,3} - image to be transformed
  • (r1map=[]) - R1 map of the object (real)
  • (r2map=[]) - R2 map of the object (real) / (R2* for GRE sequences)
  • (fmap=[]) - fieldmap (real)
  • (`opName="fast") - name of operator to use ("explicit" or "fast")
  • (sensmaps=[]) - array of coil sensitivities
  • (verbose=true) - prints the progress if true
  • kargs... - addional keyword arguments

...

MRIReco.addNoiseFunction

Adds average white gaussian noise to the signal x

Arguments

  • x::Vector - signal vector
  • 'snr::Float64' - target SNR
MRIReco.addNoiseMethod

return AcquisitionData with white gaussian noise

Arguments

  • acqData::AcquisitionData - AcquisitionData
  • 'snr::Float64' - target SNR
MRIReco.addNoise!Method

add white gaussian noise to AcquisitionData with (in-place)

Arguments

  • acqData::AcquisitionData - AcquisitionData
  • 'snr::Float64' - target SNR
MRIReco.birdcageSensitivityFunction
birdcageSensitivity(N::Int64, ncoils::Int64, relative_radius::Float64)

Computes the sensitivity maps for each coils that are arranged in a birdcage manner.

MRIReco.quadraticFieldmapFunction
quadraticFieldmap(Nx::Int64, Ny::Int64, maxOffresonance::Float64=125.0)

Computes a parabolic fieldmap.

Reconstruction

MRIReco.reconstructionMethod
reconstruction(acqData::AcquisitionData, recoParams::Dict)

takes an AcquisitionData object and a parameter dictionary and calculates an image from the given raw data.

Reconstruction types are specified by the symbol :reco. Valid reconstruction names are:

  • :direct - direct Fourier reconstruction
  • :standard - iterative reconstruction for all contrasts, coils & slices independently
  • :multiEcho - iterative joint reconstruction of all echo images
  • :multiCoil - SENSE-type iterative reconstruction
  • :multiCoilMultiEcho - SENSE-type iterative reconstruction of all echo images
MRIReco.reconstructionMethod
reconstruction(acqData::AcquisitionData, recoParams::Dict,filename::String; force=false)

performs the same image reconstrucion as reconstruction(acqData::AcquisitionData, recoParams::Dict) and saves the image in a file with name filename. If force=false, the reconstructed image is loaded from the the file filename if the latter is present.

MRIReco.setupIterativeRecoFunction
setupIterativeReco(acqData::AcquisitionData, recoParams::Dict)

builds relevant parameters and operators from the entries in recoParams

relevant parameters

  • reconSize::NTuple{2,Int64} - size of image to reconstruct
  • weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData
  • sparseTrafo::AbstractLinearOperator - sparsifying transformation
  • reg::Regularization - Regularization to be used
  • normalize::Bool - adjust regularization parameter according to the size of k-space data
  • solvername::String - name of the solver to use
  • senseMaps::Array{ComplexF64} - coil sensitivities
  • correctionMap::Array{ComplexF64} - fieldmap for the correction of off-resonance effects
  • method::String="nfft" - method to use for time-segmentation when correctio field inhomogeneities

sparseTrafo and reg can also be speficied using their names in form of a string.

MRIReco.reconstruction_direct_2dFunction
reconstruction_direct_2d(acqData::AcquisitionData, reconSize::NTuple{2,Int64}, weights::Vector{Vector{ComplexF64}}, correctionMap::Array{ComplexF64}=ComplexF64[])

Performs a direct Fourier-based image reconstruction of 2d encoded AcquisitionData

input: acqData::AcquisitionData - AcquisitionData object reconSize::NTuple{2,Int64} - size of image to reconstruct weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects

MRIReco.reconstruction_direct_3dFunction
reconstruction_direct_3d(acqData::AcquisitionData, reconSize::NTuple{3,Int64}, weights::Vector{Vector{ComplexF64}}, correctionMap::Array{ComplexF64}=ComplexF64[])

Performs a direct Fourier-based image reconstruction of 3d encoded AcquisitionData

input: acqData::AcquisitionData - AcquisitionData object reconSize::NTuple{3,Int64} - size of image to reconstruct weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects

MRIReco.reconstruction_simpleFunction

Performs iterative image reconstruction independently for the data of all coils, contrasts and slices

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • reconSize::NTuple{2,Int64} - size of image to reconstruct
  • reg::Regularization - Regularization to be used
  • sparseTrafo::AbstractLinearOperator - sparsifying transformation
  • weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData
  • solvername::String - name of the solver to use
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
  • (normalize::Bool=false) - adjust regularization parameter according to the size of k-space data
  • (params::Dict{Symbol,Any}) - Dict with additional parameters
MRIReco.reconstruction_multiEchoFunction

Performs a iterative image reconstruction jointly for all contrasts. Different slices and coil images are reconstructed independently.

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • reconSize::NTuple{2,Int64} - size of image to reconstruct
  • reg::Regularization - Regularization to be used
  • sparseTrafo::AbstractLinearOperator - sparsifying transformation
  • weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData
  • solvername::String - name of the solver to use
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
  • (normalize::Bool=false) - adjust regularization parameter according to the size of k-space data
  • (params::Dict{Symbol,Any}) - Dict with additional parameters
MRIReco.reconstruction_multiCoilFunction

Performs a SENSE-type iterative image reconstruction. Different slices and contrasts images are reconstructed independently.

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • reconSize::NTuple{2,Int64} - size of image to reconstruct
  • reg::Regularization - Regularization to be used
  • sparseTrafo::AbstractLinearOperator - sparsifying transformation
  • weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData
  • solvername::String - name of the solver to use
  • senseMaps::Array{ComplexF64} - coil sensitivities
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
  • (normalize::Bool=false) - adjust regularization parameter according to the size of k-space data
  • (params::Dict{Symbol,Any}) - Dict with additional parameters
MRIReco.reconstruction_multiCoilMultiEchoFunction

Performs a SENSE-type iterative image reconstruction which reconstructs all contrasts jointly. Different slices are reconstructed independently.

Arguments

  • acqData::AcquisitionData - AcquisitionData object
  • reconSize::NTuple{2,Int64} - size of image to reconstruct
  • reg::Regularization - Regularization to be used
  • sparseTrafo::AbstractLinearOperator - sparsifying transformation
  • weights::Vector{Vector{ComplexF64}} - sampling density of the trajectories in acqData
  • solvername::String - name of the solver to use
  • senseMaps::Array{ComplexF64} - coil sensitivities
  • (correctionMap::Array{ComplexF64}) - fieldmap for the correction of off-resonance effects
  • (method::String="nfft") - method to use for time-segmentation when correctio field inhomogeneities
  • (normalize::Bool=false) - adjust regularization parameter according to the size of k-space data
  • (params::Dict{Symbol,Any}) - Dict with additional parameters
MRIReco.espiritFunction
`maps = espirit(acqData::AcquisitionData, ksize::NTuple{2,Int64}, ncalib::Int64
           ; eigThresh_1::Float64=0.02, eigThresh_2::Float64=0.95)`

obtains coil sensitivities from a calibration area using ESPIRiT adapted from the MATLAB code by Uecker et al. for the paper' M. Uecker, P. Lai, MJ Murphy, P. Virtue, M Elad, JM Pauly, SS Vasanawala and M Lustig, "ESPIRiT- an eigenvalue approach to autocalibrating parallel MRI: Where SENSE meets GRAPPA", Magn Reson Med, 2013

the matlab code can be found at: [http://people.eecs.berkeley.edu/~mlustig/Software.html]

Arguments

  • acqData::AcquisitionData - AcquisitionData
  • ksize::NTuple{2,Int64} - size of the k-space matrix
  • ncalib::Int64 - number of calibration points in each dimension
  • eigThresh_1::Float64=0.02 - threshold for the singular values of the calibration matrix (relative to the largest value)
  • eigThresh_2::Float64=0.95 - threshold of the image space kernels (if no singular value > eigThresh_2 exists) , the corresponding pixel has a sensitivity of 0.

Returns a 4D array.

maps = espirit(calibData::Array{ComplexF64,3}, imsize::NTuple{2,Int64}, ksize::NTuple{2,Int64} ; eigThresh_1::Float64=0.02, eigThresh_2::Float64=0.95) Returns a 3D array.

MRIReco.nrmsdFunction
nrmsd(I,Ireco)

computes the normalized root mean squared error of the image Ireco with respect to the image I.