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
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 sampledredFac::Float64- subsampling factorpatFunc::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 examplerngandseed
MRISampling.sample_kspace Method
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 sampledredFac::Float64- subsampling factorpatFunc::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
MRISampling.sample_kspace Method
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 sampledredFac::Float64- subsampling factorpatFunc::String- name of the sampling function ("random", "regular", "lines", "poisson" or "vdPoisson"; with 2D data andprofiles=trueall but "lines", with 3D data andprofiles=falseonly "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 forrng; withnothing,rngis used in its current statekargs...- additional keyword arguments
Sampling Patterns
MRISampling.sample_regular Method
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 sampledredFac::Float64- subsampling factor
MRISampling.sample_random Method
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 sampledredFac::Float64- subsampling factor(
calsize::Int64=0) - size of the fully sampled calibration area(
rng=Random.default_rng()) - random number generator(
seed=nothing) - seed forrng; withnothing,rngis used in its current state
MRISampling.sample_lines Method
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".
MRISampling.sample_lines Method
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 sampledredFac::Float64- subsampling factorsampleFunc="random"- name of the sampling function ("random", "regular", "poisson" or "vdPoisson")kargs...- additional keyword arguments
MRISampling.sample_poissondisk Method
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 sampledredFac::Float64- subsampling factor(
calsize::Int64=0) - size of the fully sampled calibration area(
rng=Random.default_rng()) - random number generator(
seed=nothing) - seed forrng; withnothing,rngis used in its current state
MRISampling.sample_poissondisk Method
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}
MRISampling.sample_vdpoisson Method
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 sampledredFac::Float64- subsampling factor(
rng=Random.default_rng()) - random number generator(
seed=nothing) - seed forrng; withnothing,rngis used in its current state
MRISampling.sample_vdpoisson Method
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}
Incoherence
MRISampling.calculateIncoherence Function
calculateIncoherence(acqData::AcquisitionData, recoParams::Dict, slice=1)calculates the incoherence of the sampling pattern contained in acqData
Arguments
acqData::AcquisitionData- AcquisitionData containing the sampling patternrecoParams::Dict- Dict containing reconstruction parameters(
slice=1) - slice for which to calculate the incoherence