CLEARSWI
Documentation for CLEARSWI.
CLEARSWI.Data
CLEARSWI.Options
CLEARSWI.calculateSWI
CLEARSWI.createIntensityProjection
CLEARSWI.createMIP
CLEARSWI.dir
CLEARSWI.saveconfiguration
CLEARSWI.Data
— TypeData(mag, phase, header, TEs)
Defines a struct as input for clearSWI
CLEARSWI.Options
— TypeOptions(; mag_combine=:SNR,
mag_sens=nothing,
mag_softplus=true,
phase_unwrap=:laplacian,
phase_hp_sigma=[4,4,0],
phase_scaling_type=:tanh,
phase_scaling_strength=4,
writesteps=nothing)
mag_combine
selects the echo combination for the magnitude. Options are:SNR
:average
:last
to select the last echo(:CNR => (:gm, :wm))
to optimize the contrast between two selected tissues with the possible tissues classes to select insrc/tissue.jl
, currently only working for 7T(:echo => 3)
to select the 3rd echo(:closest => 15.3)
to select the echo that is closest to 15.3 ms(:SE => 15.3)
to simulate the contrast that would be achieved using a corresponding single-echo scan with 15.3 ms echo time.
If
mag_sens
is set to an array, it is used instead of CLEAR-SWI sensitivity estimation. This can also be set tomag_sens=[1]
to use the constant sensitivity of 1 and effectively avoid sensitivity correction. To change the sigmamm value of the expected bias field size, set it to i.e. `magsens=(:sigma_mm => 7)`. The default is 7mm.To deactivate scaling of the combined magnitude with the softplus function, use
mag_softplus=false
.phase_unwrap
is either:laplacian
,:romeo
, or:laplacianslice
(slicewise laplacian unwrapping)The
phase_hp_sigma
is used for high-pass filtering and is given in voxel for the [x,y,z]-dimension.phase_scaling_type
is the scaling function to create the phase mask and can be:tanh
or:negativetanh
for sigmoidal filtering, or:positive
,:negative
, and:triangular
for traditional SWI application.phase_scaling_strength
adjusts the strength of the created phase mask. A higherphase_scaling_strength
is a stronger phase appearance. With a traditional SWIphase_scaling_type
it corresponds to the power or number of phase mask multiplications.Set
writesteps
to the path, where intermediate steps should be saved, e.g.writesteps="/tmp/clearswi_steps"
. If set tonothing
, intermediate steps won't be saved.Set
qsm
to true
CLEARSWI.calculateSWI
— FunctioncalculateSWI(data::Data, options::Options=Options())
Returns the calculated SWI using 'data' and 'options'.
Examples
julia> TEs = [4,8,12]
julia> data = Data(mag, phase, header(mag), TEs);
julia> swi = calculateSWI(data);
With Options
Options(; mag_combine=:SNR,
mag_sens=nothing,
mag_softplus=true,
phase_unwrap=:laplacian,
phase_hp_sigma=[4,4,0],
phase_scaling_type=:tanh,
phase_scaling_strength=4,
writesteps=nothing)
mag_combine
selects the echo combination for the magnitude. Options are:SNR
:average
:last
to select the last echo(:CNR => (:gm, :wm))
to optimize the contrast between two selected tissues with the possible tissues classes to select insrc/tissue.jl
, currently only working for 7T(:echo => 3)
to select the 3rd echo(:closest => 15.3)
to select the echo that is closest to 15.3 ms(:SE => 15.3)
to simulate the contrast that would be achieved using a corresponding single-echo scan with 15.3 ms echo time.
If
mag_sens
is set to an array, it is used instead of CLEAR-SWI sensitivity estimation. This can also be set tomag_sens=[1]
to use the constant sensitivity of 1 and effectively avoid sensitivity correction. To change the sigmamm value of the expected bias field size, set it to i.e. `magsens=(:sigma_mm => 7)`. The default is 7mm.To deactivate scaling of the combined magnitude with the softplus function, use
mag_softplus=false
.phase_unwrap
is either:laplacian
,:romeo
, or:laplacianslice
(slicewise laplacian unwrapping)The
phase_hp_sigma
is used for high-pass filtering and is given in voxel for the [x,y,z]-dimension.phase_scaling_type
is the scaling function to create the phase mask and can be:tanh
or:negativetanh
for sigmoidal filtering, or:positive
,:negative
, and:triangular
for traditional SWI application.phase_scaling_strength
adjusts the strength of the created phase mask. A higherphase_scaling_strength
is a stronger phase appearance. With a traditional SWIphase_scaling_type
it corresponds to the power or number of phase mask multiplications.Set
writesteps
to the path, where intermediate steps should be saved, e.g.writesteps="/tmp/clearswi_steps"
. If set tonothing
, intermediate steps won't be saved.Set
qsm
to true
Examples
julia> TEs = [4,8,12]
julia> data = Data(mag, phase, header(mag), TEs);
julia> options = Options(phase_hp_sigma=[10,10,5], mag_softplus=false)
julia> swi = calculateSWI(data, options);
CLEARSWI.createIntensityProjection
— MethodcreateIntensityProjection(S::AbstractArray{T,3}, func, d=7) where T
Calculates an intensity projection over the 3rd dimension of S
with the function func
over d
slices. Good function are minimum
, maximum
, mean
, std
, ...
Examples
julia> using Statistics
julia> a = rand(Float64, (64,64,20))
julia> createIntensityProjection(a, std)
CLEARSWI.createMIP
— FunctioncreateMIP(S::AbstractArray{<:Number,3}, d=7)
Creates minimum intensity projection of S
over d
slices.
Examples
julia> TEs = [4,8,12]
julia> data = Data(mag, phase, header(mag), TEs);
julia> swi = calculateSWI(data);
julia> mip = createMIP(swi);
See also createIntensityProjection
CLEARSWI.dir
— MethodCLEARSWI.dir(path...)
Construct a path relative to SWI root.
Example
julia> CLEARSWI.dir("test","data","small","Mag.nii")
"/home/korbinian90/.julia/dev/CLEARSWI/test/data/small/Mag.nii"
CLEARSWI.saveconfiguration
— Functionsaveconfiguration(options::Options, path=options.writesteps)
Saves the configuration in the file "settings_swi.txt" under path