Skip to content

MRISampling ​

MRISampling creates undersampling patterns and applies them to k-space data. MRISampling depends on MRIBase. It has to be loaded with using MRISampling, because MRIReco does not depend on it. The guide Undersample k-Space shows how to use it.

Undersampling ​

MRISampling.sample Method
julia
sample(shape::NTuple{N,Int64}, redFac, patFunc::String; kargs...)

generates the indices of the samples of an Array of size shape for a reduction factor redFac. An unknown patFunc logs an error and returns nothing.

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"; in one dimension all but "lines", in three dimensions only "regular" and "lines")

  • kargs... - additional keyword arguments of the sampling function, for example rng and seed

source
MRISampling.sample_kspace Method
julia
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"; for a vector all but "lines", for a 3D array only "regular" and "lines")

  • kargs... - additional keyword arguments

source
MRISampling.sample_kspace Method
julia
sample_kspace(acqData::AcquisitionData,redFac::Float64,
            patFunc::AbstractString; rand=true, profiles=true,
            rng = Random.default_rng(), seed = nothing, kargs...)

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

Arguments

  • acqData::AcquisitionData - AcquisitionData to be sampled

  • redFac::Float64 - subsampling factor

  • patFunc::String - name of the sampling function ("random", "regular", "lines", "poisson" or "vdPoisson"; with 2D data and profiles=true all but "lines", with 3D data and profiles=false only "regular" and "lines")

  • (rand=true) - use different patterns for the different contrasts

  • (profiles=true) - sample complete profiles

  • (rng=Random.default_rng()) - random number generator

  • (seed=nothing) - seed for rng; with nothing, rng is used in its current state

  • kargs... - additional keyword arguments

source

Sampling Patterns ​

MRISampling.sample_regular Method
julia
sample_regular(shape::Tuple{Int64,Int64}, redFac;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

source
MRISampling.sample_random Method
julia
sample_random(shape::Tuple{Int64,Int64},redFac::Float64;calsize::Int64=0,rng=Random.default_rng(),seed=nothing,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

  • (rng=Random.default_rng()) - random number generator

  • (seed=nothing) - seed for rng; with nothing, rng is used in its current state

source
MRISampling.sample_lines Method
julia
sample_lines(shape::Tuple{Int64,Int64,Int64}, redFac; sampleFunc="random",kargs...)

generates a pattern to sample complete lines of an Array of size shape with a subsampling factor redFac. The arguments are the same as in the 2d case with the exception that shape is of type NTuple{3,Int64}, and sampleFunc can also be "lines".

source
MRISampling.sample_lines Method
julia
sample_lines(shape::Tuple{Int64,Int64}, redFac; sampleFunc="random",kargs...)

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

Arguments

  • shape::Tuple{Int64,Int64} - size of the Array to be sampled

  • redFac::Float64 - subsampling factor

  • sampleFunc="random" - name of the sampling function ("random", "regular", "poisson" or "vdPoisson")

  • kargs... - additional keyword arguments

source
MRISampling.sample_poissondisk Method
julia
sample_poissondisk(shape::Tuple{Int64,Int64},redFac::Float64;calsize::Int64=0, rng=Random.default_rng(), seed=nothing,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

  • (rng=Random.default_rng()) - random number generator

  • (seed=nothing) - seed for rng; with nothing, rng is used in its current state

source
MRISampling.sample_poissondisk Method
julia
sample_poissondisk(shape::Tuple{Int64},redFac;calsize::Int64=0,kargs...)

generates a Poisson disk sampling pattern for a Vector of size shape with a subsampling factor redFac. The arguments are the same as in the 2d case with the exception that shape is of type Tuple{Int64}

source
MRISampling.sample_vdpoisson Method
julia
sample_vdpoisson(shape::Tuple{Int64,Int64},redFac::Float64; rng=Random.default_rng(), seed=nothing,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

  • (rng=Random.default_rng()) - random number generator

  • (seed=nothing) - seed for rng; with nothing, rng is used in its current state

source
MRISampling.sample_vdpoisson Method
julia
sample_vdpoisson(shape::Tuple{Int64},redFac;kargs...)

generates a variable density Poisson disk sampling pattern for a Vector of size shape with a subsampling factor redFac. The arguments are the same as in the 2d case with the exception that shape is of type Tuple{Int64}

source

Incoherence ​

MRISampling.calculateIncoherence Function
julia
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

source