Musclesense comprises a set of trained neural networks for the anatomical segmentation of muscle groups in 3-point Dixon, T1w, and T2-stir, lower-limb MRI volumes.
The instructions below are for installing the software at ~/musclesense
on Linux. Replace ~
and musclesense
as appropriate if you wish to install the software elsewhere on your filesystem.
- At the Linux terminal, execute:
cd ~
followed by:
git clone https://github.com/bariskanber/musclesense.git
- Install Miniconda3 (see here) in:
~/musclesense/miniconda3
The installation script will ask for the location.
- Install the required modules by running:
~/musclesense/miniconda3/bin/python -m pip install -r ~/musclesense/requirements.txt
Please note that if the location you have installed the software to requires root privileges to write to, you may encouter a Permission denied: '.../models'
error. Run the software with sudo
once for each new modality you use and sudo
will no longer be necessary once the appropriate model files have been downloaded.
Run the following command to perform individual muscle segmentation on the two T1w calf datasets in the directory /mydir.
~/musclesense/miniconda3/bin/python ~/musclesense/mmseg_ll.py -al calf -modalities t1 -inputdir /mydir
mydir is expected to have the following directory structure:
mydir/
├── subject1/
│ └── t1.nii.gz
├── subject2/
│ └── t1.nii.gz
A file labelled calf_parcellation_t1.nii.gz will be produced in each subject directory.
Run the following command to perform whole muscle segmentation on the two T2-stir thigh datasets in the directory /mydir.
~/musclesense/miniconda3/bin/python ~/musclesense/mmseg_ll.py -al thigh -modalities t2_stir -inputdir /mydir --wholemuscle
mydir is expected to have the following directory structure:
mydir/
├── subject1/
│ └── t2_stir.nii.gz
├── subject2/
│ └── t2_stir.nii.gz
A file labelled thigh_segmentation_t2_stir.nii.gz will be produced in each subject directory.
Run the following command to perform individual muscle segmentation on the two 3-point Dixon calf datasets in the directory /mydir.
~/musclesense/miniconda3/bin/python ~/musclesense/mmseg_ll.py -al calf -modalities dixon_345_460_575 -inputdir /mydir
mydir is expected to have the following directory structure:
mydir/
├── subject1/
│ └── Dixon345.nii.gz
│ └── Dixon460.nii.gz
│ └── Dixon575.nii.gz
├── subject2/
│ └── Dixon345.nii.gz
│ └── Dixon460.nii.gz
│ └── Dixon575.nii.gz
A file labelled calf_parcellation_dixon_345_460_575.nii.gz will be produced in each subject directory.
We are grateful to the Wellcome Trust, National Institute for Health and Care Research, and National Brain Appeal for their kind funding and support of this project.
Please consider citing the following publications if you use Musclesense in your research:
- Musclesense: a trained, artificial neural network for the anatomical segmentation of lower limb magnetic resonance images in neuromuscular diseases (https://pubmed.ncbi.nlm.nih.gov/32892313/)
- Quantitative MRI outcome measures in CMT1A using automated lower limb muscle segmentation (https://pubmed.ncbi.nlm.nih.gov/37979968/)
Please submit any enquiries here.