Skip to content

balbasty/multi-bias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Bias

This code allows inferring multi-channel bias fields from, e.g., uncombined multi-coil MR images.

Dependencies

This code is written in Matlab and depends on the SPM12 software, which should be on your Matlab path.

If you have access to the development version of SPM (e.g., if you work at the FIL), it is advised to recompile SPM with OpenMP activated. This can be done by following these instructions, except that the option USE_OPENMP=1 must be specified. For example, on linux:

cd /home/login/spm12/src
make distclean
make USE_OPENMP=1 && make install
make external-distclean
make external && make external-install

Usage

Graphical

Assuming that you have a series of uncombined coil images in nifti format, and that you like graphical interfaces, the most simple usage is:

>> multibias;

You will first be asked to select all input files, then to choose an output directory. The algorithm will then run and write the results on disk. There will be as many bias field images as channels (prefixed by 'b') and one mean image (prefixed by 'm').

Command line

If more flexibility is required, multibias can be used as a function:

>> [b,m] = multibias(x, opt);

The input x can be either:

  • A 5D array: the fourth dimension should correspond to channels (and therefore to bias fields), while the fifth dimension should correspond to different contrasts. Note that in this model, bias fields are shared across contrasts and differ across channels.
  • A 2d cell array of filenames. Here the first dimension corresponds to channels and the second to contrasts. Each file should contain a 3D volume. A 5D array is built from this combination of 3D files.
  • Empty. In this case, files can be selected through the GUI.

The output are

  • b is a 4D array of estimated bias field. The fourth dimension
    corresponds to channels.
  • m is a 5D array of combined 'mean' images. The fourth dimension corresponds to contrasts, while the fourth dimension is of size 1.
  • If no output argument is asked (>> multibias(x, opt);), an output folder is asked for through the GUI and the output bias and mean images are writen on disk.

Several options are available, as fields of the opt structure:

Name Range Default Description
itermax int > 0 16 Maximum number of iterations
tol float > 0 1E-3 Gain threshold for early stopping
lambda float > 0 1E3 Regularisation factor per channel
sigma float > 0 NaN Noise standard deviation per channel
vs float > 0 NaN/1 Voxel size.
By default, it is inferred from the input headers.
If it cannot be inferred, the default value is 1.
verbose int >= 0 1 Verbosity level: 0=quiet / 1=print / 2=plot / 3=plot more
map bool false Memory map input data (slower but saves RAM)
threads int >= 0
'matlab'
'automatic'
'matlab' Number of threads used by both Matlab and SPM:
'matlab' = Matlab's current settings
'automatic = Matlab's automatic setting
mask bool false Mask of voxels to discard:
false = use all all voxels
true = estimate and mask out background
array = mask out using provided background mask
folder char '' Output folder. Do not write output files if empty.

References

This algorithm has been described and used in a couple of ISMRM abstracts:

License

This software is released under the GNU General Public License version 3 (GPL v3). As a result, you may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.

TL;DR: GPL v3

About

Fit a multi-view bias field

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages