Skip to content

Commit 3fec355

Browse files
josephmjedPys
authored andcommitted
This is a combination of 3 commits.
doc: misc setup and doc changes maint: remove unnecessary files Some reorganization, and rethinking the main workflow. Still not runnable via argparse. fix eddy_quad bindings update fork remove slice timing req update Dockerfile fix imports in qc update MANIFEST.in update bids.py update bids.py update Dockerfile to include new eddy turn off cnr_maps with eddy update Dockerfile with fsl 5.0.11 add nlsam denoising to dockerfile add nlsam denoising option add nlsam denoising option fix nlsam, add eddy args fix nlsam, add eddy args create new cli skeleton create new cli skeleton create new cli skeleton add support for multiple sessions and multi-file concatenation add meta-wf handling reorder workflow stages in light of recommendations from Maximov et al. 2019, Ades-Aron et al. 2018(a), Ades-Aron et al. 2018(b) rename final dwi output to make it identifiable adjust ART norm thresh split noise estimation stage and denoising tweak cores/mem alloc liter eddy fix verbosity, refine eddy memory reqs save final bval/bvec as txt update Dockerfile, reduce size fix bug with eddy_quad base_name workflow end-end completion update Dockerfile tweak mem restrictions update mem restrictions fine-tune resource handling fine-tune resource consumption more resource handling fine-tuning refine resource handling add support to drop outliers from sigma if 4d openMP handling squash/merge final pre-meeting add sigma switch to drop_outliers_fn fix sigma fix sigma issue change os.rename to shutil.copy to handle linking across mounted filesystems resource handling remove array passing to alleviate memory/pickling errors update eddy mem reqs fix topup odd slice option update eddy mem reqs fix b02b0.cfg bug for odd slices simplify b02b0.cnf specify handling for second-level modeling in eddy if data is detected as hemispheric specify handling for second-level modeling in eddy if data is detected as hemispheric FIX: send empty str to 'args' trait of an EddyInputSpec empty str to eddy args for non-reverse-phase empty str to eddy args for non-reverse-phase: PR fix slm str trait bug adjust .cnf hyperparameter window adjust .cnf hyperparameter window
1 parent 70f7591 commit 3fec355

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3369
-5901
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ out/
3939
.zenodo.json
4040
.travis.yml
4141
.readthedocs.yml
42-
CONTRIBUTING.md
42+
CONTRIBUTING.rst

.github/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ newPRWelcomeComment: >
55
Thanks for opening this pull request!
66
We have detected this is the first time for you to contribute
77
to *dMRIPrep*.
8-
Please check out our [contributing guidelines](https://github.com/nipreps/dmriprep/blob/master/CONTRIBUTING.md).
8+
Please check out our [contributing guidelines](https://github.com/nipreps/dmriprep/blob/master/CONTRIBUTING.rst).
99
1010
We invite you to list yourself as a *dMRIPrep* contributor, so if your name
1111
is not already mentioned, please modify the

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,3 @@ ENV/
103103

104104
# Mac OS nonsense:
105105
.DS_Store
106-
107-
# miscellaneous
108-
references/

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"title": "dMRIPrep: a robust preprocessing pipeline for diffusion MRI",
44
"description": "<p>dMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse dMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.</p>",
55
"creators": [
6+
{
7+
"affiliation": "University of Texas at Austin",
8+
"name": "Pisner, Derek",
9+
"orcid": "0000-0002-1228-0201"
10+
},
611
{
712
"affiliation": "Stanford University",
813
"name": "Lerma-Usabiaga, Garikoitz",

CONTRIBUTING.rst

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,6 @@
44
Contributing
55
============
66

7-
.. code-block:: console
8-
9-
dmriprep
10-
├── CHANGES.rst
11-
├── CONTRIBUTING.rst
12-
├── dmriprep
13-
│   ├── __about__.py
14-
│   ├── cli.py
15-
│   ├── data
16-
│   │   ├── boilerplate.bib
17-
| | ├── eddy_parameters
18-
│   │   └── ENIGMA_targets
19-
│   ├── due.py
20-
│   ├── __init__.py
21-
│   ├── interfaces
22-
│   │   ├── fmap.py
23-
│   │   ├── __init__.py
24-
│   │   └── reportlets.py
25-
│   ├── qc.py
26-
│   ├── utils
27-
│   │   ├── bids.py
28-
│   │   ├── hemisphere.py
29-
│   │   └── __init__.py
30-
│   ├── _version.py
31-
│   ├── viz
32-
│   │   ├── __init__.py
33-
│   │   └── utils.py
34-
│   └── workflows
35-
│   ├── anatomical.py
36-
│   ├── base.py
37-
│   ├── dwi
38-
│   │   ├── __init__.py
39-
│   │   ├── artifacts.py
40-
│   │   ├── base.py
41-
│   │   ├── eddy.py
42-
│   │   ├── outputs.py
43-
│   │   ├── qc.py
44-
│   │   ├── tensor.py
45-
│   │   └── util.py
46-
│   ├── fieldmap
47-
│   │   ├── __init__.py
48-
│   │   ├── ants.py
49-
│   │   ├── base.py
50-
│   │   ├── brainsuite.py
51-
│   │   ├── fmap.py
52-
│   │   ├── pepolar.py
53-
│   │   ├── phasediff.py
54-
│   │   └── synb0.py
55-
│   └── __init__.py
56-
├── Dockerfile
57-
├── docs
58-
├── LICENSE
59-
├── long_description.rst
60-
├── Makefile
61-
├── MANIFEST.in
62-
├── pyproject.toml
63-
├── README.rst
64-
├── REFERENCES.rst
65-
├── setup.cfg
66-
├── setup.py
67-
├── tests
68-
│   ├── __init__.py
69-
│   ├── test_dmriprep.py
70-
│   └── test_utils.py
71-
├── tox.ini
72-
├── update_changes.sh
73-
└── versioneer.py
74-
757
We love contributions! dmriprep is open source, built on open source,
768
and we'd love to have you hang out in our community.
779

Dockerfile

Lines changed: 76 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM ubuntu:xenial-20161213
33

44
# Pre-cache neurodebian key
5-
COPY .docker/neurodebian.gpg /usr/local/etc/neurodebian.gpg
5+
COPY docker/files/neurodebian.gpg /usr/local/etc/neurodebian.gpg
66

77
# Prepare environment
88
RUN apt-get update && \
@@ -16,6 +16,10 @@ RUN apt-get update && \
1616
autoconf \
1717
libtool \
1818
pkg-config \
19+
vim \
20+
zip \
21+
unzip \
22+
wget \
1923
git && \
2024
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
2125
apt-get install -y --no-install-recommends \
@@ -27,43 +31,13 @@ RUN curl -o pandoc-2.2.2.1-1-amd64.deb -sSL "https://github.com/jgm/pandoc/relea
2731
dpkg -i pandoc-2.2.2.1-1-amd64.deb && \
2832
rm pandoc-2.2.2.1-1-amd64.deb
2933

30-
# Installing freesurfer
31-
RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz | tar zxv --no-same-owner -C /opt \
32-
--exclude='freesurfer/diffusion' \
33-
--exclude='freesurfer/docs' \
34-
--exclude='freesurfer/fsfast' \
35-
--exclude='freesurfer/lib/cuda' \
36-
--exclude='freesurfer/lib/qt' \
37-
--exclude='freesurfer/matlab' \
38-
--exclude='freesurfer/mni/share/man' \
39-
--exclude='freesurfer/subjects/fsaverage_sym' \
40-
--exclude='freesurfer/subjects/fsaverage3' \
41-
--exclude='freesurfer/subjects/fsaverage4' \
42-
--exclude='freesurfer/subjects/cvs_avg35' \
43-
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
44-
--exclude='freesurfer/subjects/bert' \
45-
--exclude='freesurfer/subjects/lh.EC_average' \
46-
--exclude='freesurfer/subjects/rh.EC_average' \
47-
--exclude='freesurfer/subjects/sample-*.mgz' \
48-
--exclude='freesurfer/subjects/V1_average' \
49-
--exclude='freesurfer/trctrain'
50-
5134
ENV FSL_DIR="/usr/share/fsl/5.0" \
5235
OS="Linux" \
5336
FS_OVERRIDE=0 \
5437
FIX_VERTEX_AREA="" \
55-
FSF_OUTPUT_FORMAT="nii.gz" \
56-
FREESURFER_HOME="/opt/freesurfer"
57-
ENV SUBJECTS_DIR="$FREESURFER_HOME/subjects" \
58-
FUNCTIONALS_DIR="$FREESURFER_HOME/sessions" \
59-
MNI_DIR="$FREESURFER_HOME/mni" \
60-
LOCAL_DIR="$FREESURFER_HOME/local" \
61-
MINC_BIN_DIR="$FREESURFER_HOME/mni/bin" \
62-
MINC_LIB_DIR="$FREESURFER_HOME/mni/lib" \
63-
MNI_DATAPATH="$FREESURFER_HOME/mni/data"
38+
FSF_OUTPUT_FORMAT="nii.gz"
6439
ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
65-
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
66-
PATH="$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
40+
MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5"
6741

6842
# Installing Neurodebian packages (FSL, AFNI, git)
6943
RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
@@ -72,32 +46,63 @@ RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca
7246

7347
RUN apt-get update && \
7448
apt-get install -y --no-install-recommends \
75-
fsl-core=5.0.9-5~nd16.04+1 \
76-
fsl-mni152-templates=5.0.7-2 \
7749
afni=16.2.07~dfsg.1-5~nd16.04+1 \
78-
convert3d \
7950
git-annex-standalone && \
8051
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8152

82-
ENV FSLDIR="/usr/share/fsl/5.0" \
83-
FSLOUTPUTTYPE="NIFTI_GZ" \
84-
FSLMULTIFILEQUIT="TRUE" \
85-
POSSUMDIR="/usr/share/fsl/5.0" \
86-
LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH" \
87-
FSLTCLSH="/usr/bin/tclsh" \
88-
FSLWISH="/usr/bin/wish" \
89-
AFNI_MODELPATH="/usr/lib/afni/models" \
90-
AFNI_IMSAVE_WARNINGS="NO" \
91-
AFNI_TTATLAS_DATASET="/usr/share/afni/atlases" \
92-
AFNI_PLUGINPATH="/usr/lib/afni/plugins"
93-
ENV PATH="/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH"
53+
ENV FSLDIR="/opt/fsl-6.0.1" \
54+
PATH="/opt/fsl-6.0.1/bin:$PATH" \
55+
FSLOUTPUTTYPE="NIFTI_GZ"
56+
RUN apt-get update -qq \
57+
&& apt-get install -y -q --no-install-recommends \
58+
bc \
59+
dc \
60+
file \
61+
libfontconfig1 \
62+
libfreetype6 \
63+
libgl1-mesa-dev \
64+
libglu1-mesa-dev \
65+
libgomp1 \
66+
libice6 \
67+
libxcursor1 \
68+
libxft2 \
69+
libxinerama1 \
70+
libxrandr2 \
71+
libxrender1 \
72+
libxt6 \
73+
&& apt-get clean \
74+
&& rm -rf /var/lib/apt/lists/* \
75+
&& echo "Downloading FSL ..." \
76+
&& wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \
77+
&& chmod 775 fslinstaller.py
78+
RUN /fslinstaller.py -d /opt/fsl-6.0.1 -V 6.0.1 -q
79+
80+
RUN rm -rf /opt/fsl-6.0.1/data \
81+
&& rm -rf /opt/fsl-6.0.1/bin/FSLeyes* \
82+
&& rm -rf /opt/fsl-6.0.1/src \
83+
&& rm -rf /opt/fsl-6.0.1/extras/src \
84+
&& rm -rf /opt/fsl-6.0.1/doc \
85+
&& rm -rf /opt/fsl-6.0.1/bin/fslview.app \
86+
&& rm -rf /opt/fsl-6.0.1/data/atlases \
87+
&& rm -rf /opt/fsl-6.0.1/data/first \
88+
&& rm -rf /opt/fsl-6.0.1/data/mist \
89+
&& rm -rf /opt/fsl-6.0.1/data/possum
9490

9591
# Installing ANTs 2.2.0 (NeuroDocker build)
9692
ENV ANTSPATH=/usr/lib/ants
9793
RUN mkdir -p $ANTSPATH && \
9894
curl -sSL "https://dl.dropbox.com/s/2f4sui1z6lcgyek/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz" \
9995
| tar -xzC $ANTSPATH --strip-components 1
100-
ENV PATH=$ANTSPATH:$PATH
96+
97+
ENV AFNI_INSTALLDIR=/usr/lib/afni \
98+
PATH=${PATH}:/usr/lib/afni/bin \
99+
AFNI_PLUGINPATH=/usr/lib/afni/plugins \
100+
AFNI_MODELPATH=/usr/lib/afni/models \
101+
AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \
102+
AFNI_IMSAVE_WARNINGS=NO \
103+
FSLOUTPUTTYPE=NIFTI_GZ \
104+
PATH=$ANTSPATH:$PATH \
105+
ANTS_VERSION=2.2.0
101106

102107
# Create a shared $HOME directory
103108
RUN useradd -m -s /bin/bash -G users dmriprep
@@ -112,14 +117,6 @@ RUN npm install -g svgo
112117
# Installing bids-validator
113118
RUN npm install -g [email protected]
114119

115-
# Installing and setting up ICA_AROMA
116-
RUN mkdir -p /opt/ICA-AROMA && \
117-
curl -sSL "https://github.com/maartenmennes/ICA-AROMA/archive/v0.4.4-beta.tar.gz" \
118-
| tar -xzC /opt/ICA-AROMA --strip-components 1 && \
119-
chmod +x /opt/ICA-AROMA/ICA_AROMA.py
120-
121-
ENV PATH=/opt/ICA-AROMA:$PATH
122-
123120
# Installing and setting up miniconda
124121
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh && \
125122
bash Miniconda3-4.5.11-Linux-x86_64.sh -b -p /usr/local/miniconda && \
@@ -147,6 +144,7 @@ RUN conda install -y python=3.7.1 \
147144
graphviz=2.40.1 \
148145
traits=4.6.0 \
149146
zlib; sync && \
147+
cython && \
150148
chmod -R a+rX /usr/local/miniconda; sync && \
151149
chmod +x /usr/local/miniconda/bin/*; sync && \
152150
conda build purge-all; sync && \
@@ -161,26 +159,33 @@ ENV MKL_NUM_THREADS=1 \
161159
RUN python -c "from matplotlib import font_manager" && \
162160
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )
163161

164-
# Precaching atlases
165-
RUN pip install --no-cache-dir "templateflow>=0.4.0,<0.5.0a0" && \
166-
python -c "from templateflow import api as tfapi; \
167-
tfapi.get('MNI152NLin6Asym', atlas=None, extension=['.nii', '.nii.gz']); \
168-
tfapi.get('MNI152NLin2009cAsym', atlas=None, extension=['.nii', '.nii.gz']); \
169-
tfapi.get('OASIS30ANTs', extension=['.nii', '.nii.gz']);" && \
170-
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
171-
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
162+
RUN pip install --upgrade pip
163+
164+
RUN apt-get update && apt-get install -y \
165+
gfortran \
166+
liblapack-dev \
167+
libopenblas-dev
168+
169+
RUN pip install ipython cython parse
172170

173171
# Installing DMRIPREP
174-
COPY . /src/dmriprep
175-
ARG VERSION
176-
# Force static versioning within container
177-
RUN echo "${VERSION}" > /src/dmriprep/dmriprep/VERSION && \
178-
echo "include dmriprep/VERSION" >> /src/dmriprep/MANIFEST.in && \
179-
pip install --no-cache-dir "/src/dmriprep[all]"
172+
RUN git clone -b nipreps https://github.com/dPys/dmriprep.git dmriprep && \
173+
cd dmriprep && \
174+
python setup.py install
175+
176+
RUN pip install ipython cython parse
177+
178+
RUN pip install --no-cache-dir https://github.com/samuelstjean/nlsam/archive/master.zip
180179

181180
RUN find $HOME -type d -exec chmod go=u {} + && \
182181
find $HOME -type f -exec chmod go=u {} +
183182

183+
RUN mkdir /inputs && \
184+
chmod -R 777 /inputs
185+
186+
RUN mkdir /outputs && \
187+
chmod -R 777 /outputs
188+
184189
ENV IS_DOCKER_8395080871=1
185190

186191
RUN ldconfig

MANIFEST.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,20 @@ include LICENSE
55
# versioneer
66
include versioneer.py
77
include dmriprep/_version.py
8+
recursive-include * *.nii.gz
9+
recursive-include * *.html
10+
recursive-include * *.js
11+
recursive-include * *.json
12+
recursive-include * *.txt
13+
recursive-include * *.csv
14+
recursive-include dmriprep/viz *
15+
recursive-include dmriprep/utils *
16+
recursive-include dmriprep/interfaces *
17+
recursive-include dmriprep/data *
18+
recursive-include dmriprep/config *
19+
recursive-include dmriprep/cli *
20+
recursive-include tests *
21+
recursive-exclude * __pycache__
22+
recursive-exclude * *.py[co]
23+
recursive-include * *.yaml
24+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ dist: clean ## builds source and wheel package
8787
install: clean ## install the package to the active Python's site-packages
8888
python setup.py install
8989

90-
docker-dev: ## build the development environment
91-
docker build -t dmriprep:dev -f docker/Dockerfile docker/.
92-
93-
docker: docker-dev
94-
docker build -t dmriprep:prod -f Dockerfile-dmriprep .
90+
docker: docker
91+
docker build --rm -t nipreps/dmriprep:latest \
92+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
93+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
94+
--build-arg VERSION=$( python get_version.py ) .

REFERENCES.rst

Lines changed: 0 additions & 20 deletions
This file was deleted.

dmriprep/.idea/dmriprep.iml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)