In this repository I will share my PhD codes for supervised and non-supervised machine learning models for the quantification of lumbar paraspinal muscle health using conventional T2-weighted MRI. The repository will contain programming codes (Python) for:
-
Convolutional Neural Networks for the automatic segmentation of the lumbar paraspinal muscles
Link to paper: https://www.nature.com/articles/s41598-022-16710-5
-
Quantifying lumbar paraspinal intramuscular fat from clinical MRI
Link to paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10869289/
Make sure you have the following dependencies installed:
- Python 3.x
- NumPy
- Pandas
- SciPy
- scikit-learn
- nibabel
You can install all the dependencies by running:
pip install -r requirements.txtThis will install all the required packages listed in the requirements.txt file. Make sure you have pip installed and configured on your system.
To use the code, follow these steps:
- Clone this repository to your local machine:
git clone https://github.com/Eddowesselink/PhD.git- Navigate to the code directory where you stored the repository
cd `/path/to/your/repository`- Run the script main_thresholding.py with the required arguments:
python main_thresholding.py --data_dir /path/to/your/data --kmeans --gmmReplace /path/to/your/data with the path to the directory containing your MRI data. You can specify either --kmeans or --gmm to choose between KMeans or Gaussian Mixture Model clustering for segmentation.
- Run the script main_CNN.py with the required arguments:
python main_thresholding.py --data_dir /path/to/your/data --model_dir /path/to/your/data Replace /path/to/your/data in -- data_dir with the path to the directory containing your MRI data.
Replace /path/to/your/data in --model_dir with the path to the directory containing the model parameters.
