Skip to content

Commit

Permalink
Merge branch 'feat/rollout_mocks' of https://github.com/alexvcaron/sc…
Browse files Browse the repository at this point in the history
…ilpy into pr/AlexVCaron/664
  • Loading branch information
AlexVCaron committed Oct 23, 2023
2 parents ea25380 + 4e51d61 commit 28f5aab
Show file tree
Hide file tree
Showing 125 changed files with 6,077 additions and 2,697 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/freeze_requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name : Freeze release requirements

on:
push:
tags:
- '*'

jobs:
freeze_requirements:
runs-on: ubuntu-latest
steps:
-
name: Checkout scilpy
uses: actions/checkout@v3
-
name: Install python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
cache: 'pip'
-
name: Freeze requirements
id: requirements-freezer
run: |
pip install pip-tools
pip-compile --no-upgrade --allow-unsafe -o requirements.${{ github.ref_name }}.frozen
echo "requirements=$PWD/requirements.${{ github.ref_name }}.frozen" >> $GITHUB_OUTPUT
-
name: Upload frozen requirements to release
uses: softprops/action-gh-release@v1
with:
files : ${{ steps.requirements-freezer.outputs.requirements }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ pipeline {
stages {
stage('Build') {
stages {
stage('Python3.7') {
stage('Python3.10') {
steps {
withPythonEnv('CPython-3.7') {
withPythonEnv('CPython-3.10') {
sh '''
pip3 install wheel==0.37.*
pip3 install numpy==1.21.*
pip3 install wheel==0.38.*
pip3 install numpy==1.23.*
pip3 install Cython==0.29.*
pip3 install -e .
'''
Expand All @@ -21,10 +21,10 @@ pipeline {

stage('Test') {
steps {
withPythonEnv('CPython-3.7') {
withPythonEnv('CPython-3.10') {
sh '''
pip3 install wheel==0.37.*
pip3 install numpy==1.21.*
pip3 install wheel==0.38.*
pip3 install numpy==1.23.*
pip3 install -e .
export MPLBACKEND="agg"
export OPENBLAS_NUM_THREADS=1
Expand All @@ -51,7 +51,7 @@ pipeline {
pullRequest.createReviewRequests(['arnaudbore'])
}
else{
pullRequest.createReviewRequests(['GuillaumeTh'])
pullRequest.createReviewRequests(['frheault'])
}
}
}
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,38 @@
**Scilpy** mainly comprises tools and utilities to quickly work with diffusion MRI. Most of the tools are based
on or are wrappers of the [DIPY] library, and most of them will eventually be migrated to [DIPY]. Those tools implement the recommended workflows and parameters used in the lab.

The library is now built for Python 3.10 so be sure to create a virtual environnement for Python 3.10. If this version is not installed on your computer:
```
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install python3.10 python3.10-dev python3.10-venv python3.10-minimal python3.10-tk
```

Make sure your pip is up-to-date before trying to install:
```
pip install --upgrade pip
```

The library's structure is mostly aligned on that of [DIPY].
The library and scripts can be installed locally by using:
```
pip install -e .
```

On Linux, most likely you will have to install libraries for COMMIT/AMICO
```
sudo apt install libblas-dev liblapack-dev
```
On Ubuntu-20.04, you will have to install libraries for matplotlib
```
sudo apt install libfreetype6-dev
```

While on MacOS you will have to use (most likely)
```
brew install openblas lapack
```

On Ubuntu >=20.04, you will have to install libraries for matplotlib
```
sudo apt install libfreetype6-dev
```

Note that using this technique will make it harder to remove the scripts when changing versions.
We highly recommend working in a [Python Virtual Environment].

Expand Down
21 changes: 0 additions & 21 deletions containers/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions containers/singularity_scilpy.def

This file was deleted.

20 changes: 20 additions & 0 deletions docs/source/documentation/btensor_scripts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Instructions for tensor-valued dMRI scripts (b-tensor)
======================================================


The scripts for multi-encoding multi-shell multi-tissue CSD (memsmt-CSD) are based on P. Karan et al., Bridging the gap between constrained spherical deconvolution and diffusional variance decomposition via tensor-valued diffusion MRI. Medical Image Analysis (2022). We recommend reading it to understand the scope of the memsmt-CSD problem.

If you want to do CSD with b-tensor data, you should start by computing the fiber response functions. This script should run fast (less than 5 minutes on a full brain).
::

scil_compute_memsmt_frf.py wm_frf.txt gm_frf.txt csf_frf.txt --in_dwis dwi_linear.nii.gz dwi_planar.nii.gz dwi_spherical.nii.gz --in_bvals dwi_linear.bval dwi_planar.bval dwi_spherical.bval --in_bvecs dwi_linear.bvec dwi_planar.bvec dwi_spherical.bvec --in_bdeltas 1 -0.5 0 --mask mask.nii.gz --mask_wm wm_mask.nii.gz --mask_gm gm_mask.nii.gz --mask_csf csf_mask.nii.gz -f

Then, you should compute the fODFs and volume fractions. The following command will save a fODF file for each tissue and a volume fractions file. This script should run in about 1-2 hours for a full brain.
::

scil_compute_memsmt_fodf.py wm_frf.txt gm_frf.txt csf_frf.txt --in_dwis dwi_linear.nii.gz dwi_planar.nii.gz dwi_spherical.nii.gz --in_bvals dwi_linear.bval dwi_planar.bval dwi_spherical.bval --in_bvecs dwi_linear.bvec dwi_planar.bvec dwi_spherical.bvec --in_bdeltas 1 -0.5 0 --mask mask.nii.gz --processes 8 -f

If you want to do DIVIDE with b-tensor data, you should use the following command. It will save files for the MD, uFA, OP, MK_I, MK_A and MK_T. This script should run in about 1-2 hours for a full brain.
::

scil_compute_divide.py --in_dwis dwi_linear.nii.gz dwi_planar.nii.gz dwi_spherical.nii.gz --in_bvals dwi_linear.bval dwi_planar.bval dwi_spherical.bval --in_bvecs dwi_linear.bvec dwi_planar.bvec dwi_spherical.bvec --in_bdeltas 1 -0.5 0 --mask mask.nii.gz --fa fa.nii.gz --processes 8 -f
5 changes: 1 addition & 4 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ filterwarnings =
once:::cvxpy
once:::dmri-amico

usefixtures =
apply_mocks

required_plugins =
pytest_console_scripts
pytest-console-scripts
pytest-mock
77 changes: 40 additions & 37 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
bids-validator==1.9.*
bctpy==0.5.*
bz2file==0.98.*
coloredlogs==10.0.*
cycler==0.10.*
Cython==0.29.*
dipy==1.5.*
docopt==0.6.2
fury==0.7.*
future==0.17.*
h5py==2.10.*
joblib==1.1.0
kiwisolver==1.0.*
matplotlib==2.2.*
nibabel==3.0.*
nilearn==0.6.*
numpy==1.21.*
Pillow==9.0.1
bids-validator==1.6.0
coloredlogs==15.0.*
cvxpy==1.3.*
cycler==0.11.*
Cython==0.29.*, !=0.29.29
# dipy==1.6.*
dmri-amico==1.5.*
dmri-commit==1.6.*
docopt==0.6.*
formulaic==0.3.*
fury==0.8.*
future==0.18.*
h5py==3.7.*
joblib==1.2.*
kiwisolver==1.4.*
matplotlib==3.6.*
nibabel==4.0.*
nilearn==0.9.*
numpy==1.23.*
openpyxl==3.0.*
Pillow==9.3.*
pybids==0.15.*
pyparsing==2.2.*
pyparsing==3.0.*
PySocks==1.7.*
python-dateutil==2.7.*
pytz==2018.4.*
scikit-learn==0.22.*
scipy==1.4.*
setuptools==46.1.*
six==1.15.*
vtk>=8.0.0,<10.0.0
trimeshpy==0.0.*
coloredlogs==10.0.*
nilearn==0.6.*
pytest==5.3.*
pytest_console_scripts==0.2.*
pytest==7.2.*
pytest-console-scripts==1.3.*
pytest-mock==3.10.*
requests==2.23.*
bctpy==0.5.*
statsmodels==0.11.*
dmri-commit==1.4.*
openpyxl==2.6.*
cvxpy==1.1.*
dmri-amico==1.2.*
formulaic==0.2.4
python-dateutil==2.8.*
pytz==2022.6.*
requests==2.28.*
scikit-learn==1.2.*
scipy==1.9.*
six==1.16.*
spams==2.6.*
statsmodels==0.13.*
trimeshpy==0.0.2
vtk==9.2.*
# Dipy requirements
h5py>=2.8.0
packaging>=19.0
tqdm>=4.30.0
-e git+https://github.com/scilus/[email protected]#egg=dipy
Empty file added scilpy/connectivity/__init__.py
Empty file.
Loading

0 comments on commit 28f5aab

Please sign in to comment.