IVIM_fit
Preprocessing diffusion MRI data and fitting IVIM models
How to use locally:
- Clone the repository in Sherlock using
git clone https://github.com/PostonLab/IVIM_fit.git.cdinto the cloned repository, thencdinto the ivim_fit directory within the repository. You should see arun.pyfile there. - Install poetry version 1.8.5 using
python3 -m pip install poetry==1.8.5 - Install dependencies with
poetry install, then usepoetry shellto activate the virtual environment. - First run the workflow dry-run with python
./run.py <path to bids data> <path to output> participant -np. - If the dry run is successful, we can run the workflow with
python ./run.py <path to bids data> <path to output> participant -c all --use-singularity. Where-cis for number of cores you want to use.allwill use everything available. - When running for the first time, it will install all the singularity containers.
How to run in Sherlock cluster at Stanford:
- Clone the repository in Sherlock using
git clone https://github.com/PostonLab/IVIM_fit.git.cdinto the cloned repository, thencdinto the ivim_fit directory within the repository. You should see arun.pyfile there. (If you see the error:fatal: unable to access 'https://github.com/PostonLab/IVIM_fit.git/': error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none, first manually point git to the CA bundle withgit config --global http.sslCAInfo /etc/ssl/certs/ca-bundle.crt, then trygit cloneagain.) - Activate an interractive shell using
salloc - Load python3 using
ml python/3.9.0 - Create a python environment
python3.9 -m venv <name> - Activate the environment
source <venv_name>/bin/activate - Install dependencies with
poetry install. [If poetry version 1.8.5 is not already installed, install it usingpython3 -m pip install poetry==1.8.5, then rerunpoetry install(recommended), orwget -O - https://install.python-poetry.org | python3 - --version 1.8.5]. If needed install six package usingpython3 -m pip install six) - Deactivate the existing python environment using
deactivate. Then usepoetry shellto activate the new ivim virtual environment. - Navigate to
ivim_fitdirectory usingcd ivim_fitwhere you will see therun.pyfile. - First run the workflow dry-run with
python ./run.py <path to bids data> <path to output> participant -np. - If the dry run is successful, we can run the workflow with
python ./run.py <path to bids data> <path to output> participant -c all --use-singularity. Where-cis for number of cores you want to use.allwill use everything available. - If running again, first load python 3.9 using
ml python/3.9.0, and then runpoetry shellto activae the python environment.
How to contribute:
- Clone the repository with
git clone https://github.com/PostonLab/IVIM_fit.git - Checkout a branch and make changes.
- Before doing
git add ., runpoe quality. This will automatically run formatting and make necessary changes. - If everything looks pretty, proceed with pushing changes.
- Go to github and make a pull request for your changes.
Acknowledgement
This project utilizes code adapted from the snakedwi pipeline ([https://github.com/akhanf/snakedwi]), an open-source project for diffusion MRI preprocessing. Their work provided a valuable foundation for building the preprocessing steps of IVIM_fit pipeline.