Skip to content

Commit

Permalink
Merge pull request #106 from DCAN-Labs/rc-3.2.0
Browse files Browse the repository at this point in the history
RC 3.2.0
  • Loading branch information
BarryTik authored Apr 30, 2024
2 parents 5c2353e + e6bae23 commit 8c7538c
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 306 deletions.
158 changes: 16 additions & 142 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,146 +49,26 @@ RUN apt-get update -qq \
&& rm -rf /var/lib/apt/lists/* \
&& echo "Downloading FSL ..." \
&& mkdir -p /opt/fsl-6.0.5.1 \
&& curl -fsSL --retry 5 "https://s3.msi.umn.edu/cabinet-fsl-install/fsl-6.0.5.1-centos7_64.tar.gz" \
| tar -xz -C /opt/fsl-6.0.5.1 --no-same-owner --strip-components 1 \
--exclude "fsl/config" \
--exclude "fsl/data/first" \
--exclude "fsl/data/mist" \
--exclude "fsl/data/possum" \
--exclude "fsl/data/standard/bianca" \
--exclude "fsl/data/standard/tissuepriors" \
--exclude "fsl/doc" \
--exclude "fsl/etc/default_flobs.flobs" \
--exclude "fsl/etc/js" \
--exclude "fsl/etc/luts" \
--exclude "fsl/etc/matlab" \
--exclude "fsl/extras" \
--exclude "fsl/include" \
--exclude "fsl/refdoc" \
--exclude "fsl/src" \
--exclude "fsl/tcl" \
--exclude "fsl/bin/FSLeyes" \
--exclude "fsl/bin/probtrackx2_gpu" \
--exclude "fsl/bin/mist" \
--exclude "fsl/bin/eddy_cuda8.0" \
--exclude "fsl/bin/eddy_cuda10.2" \
--exclude "fsl/bin/eddy_cuda9.1" \
--exclude "fsl/bin/melodic" \
--exclude "fsl/bin/eddy_openmp" \
--exclude "fsl/bin/fabber_asl" \
--exclude "fsl/bin/fabber_cest" \
--exclude "fsl/bin/probtrackx2" \
--exclude "fsl/bin/flameo" \
--exclude "fsl/bin/run_mesh_utils" \
--exclude "fsl/bin/fabber_dualecho" \
--exclude "fsl/bin/fabber_dsc" \
--exclude "fsl/bin/fabber_dce" \
--exclude "fsl/bin/fdt_matrix_merge" \
--exclude "fsl/bin/mvntool" \
--exclude "fsl/bin/fabber" \
--exclude "fsl/bin/fabber_dwi" \
--exclude "fsl/bin/fabber_pet" \
--exclude "fsl/bin/fabber_qbold" \
--exclude "fsl/bin/fabber_t1" \
--exclude "fsl/bin/surf_proj" \
--exclude "fsl/bin/surf2surf" \
--exclude "fsl/bin/probtrackx" \
--exclude "fsl/bin/film_gls" \
--exclude "fsl/bin/ftoz" \
--exclude "fsl/bin/ttoz" \
--exclude "fsl/bin/ttologp" \
--exclude "fsl/bin/contrast_mgr" \
--exclude "fsl/bin/qboot" \
--exclude "fsl/bin/cluster" \
--exclude "fsl/bin/xfibres" \
--exclude "fsl/bin/dtifit" \
--exclude "fsl/bin/vecreg" \
--exclude "fsl/binfsl_mvlm" \
--exclude "fsl/bin/new_invwarp" \
--exclude "fsl/bin/mm" \
--exclude "fsl/binfsl_regfilt" \
--exclude "fsl/bin/pvmfit" \
--exclude "fsl/binfsl_sbca" \
--exclude "fsl/binfslsurfacemaths" \
--exclude "fsl/binfsl_glm" \
--exclude "fsl/bin/swe" \
--exclude "fsl/binfsl_schurprod" \
--exclude "fsl/bin/first_utils" \
--exclude "fsl/bin/filmbabe" \
--exclude "fsl/bin/surf2volume" \
--exclude "fsl/bin/first" \
--exclude "fsl/bin/find_the_biggest" \
--exclude "fsl/bin/feat_model" \
--exclude "fsl/bin/tsplot" \
--exclude "fsl/bin/proj_thresh" \
--exclude "fsl/bin/midtrans" \
--exclude "fsl/binfsl_histogram" \
--exclude "fsl/bin/pulse" \
--exclude "fsl/bin/possum" \
--exclude "fsl/bin/asl_mfree" \
--exclude "fsl/bin/fugue" \
--exclude "fsl/bin/asl_file" \
--exclude "fsl/bin/fast" \
--exclude "fsl/bin/ccops" \
--exclude "fsl/bin/swap_subjectwise" \
--exclude "fsl/bin/swap_voxelwise" \
--exclude "fsl/bin/estimate_metric_distortion" \
--exclude "fsl/bin/prelude" \
--exclude "fsl/bin/betsurf" \
--exclude "fsl/bin/bet2" \
--exclude "fsl/bin/sigloss" \
--exclude "fsl/bin/pointflirt" \
--exclude "fsl/bin/signal2image" \
--exclude "fsl/bin/xfibres_gpu" \
--exclude "fsl/bin/pnm_evs" \
--exclude "fsl/bin/b0calc" \
--exclude "fsl/bin/merge_parts_gpu" \
--exclude "fsl/bin/slicer" \
--exclude "fsl/bin/dtigen" \
--exclude "fsl/bin/drawmesh" \
--exclude "fsl/bin/makerot" \
--exclude "fsl/bin/lesion_filling" \
--exclude "fsl/bin/distancemap" \
--exclude "fsl/bin/overlay" \
--exclude "fsl/bin/prewhiten" \
--exclude "fsl/bin/fdr" \
--exclude "fsl/bin/spharm_rm" \
--exclude "fsl/bin/tbss_skeleton" \
--exclude "fsl/binfslcc" \
--exclude "fsl/bin/slicetimer" \
--exclude "fsl/binfslsmoothfill" \
--exclude "fsl/bin/first_mult_bcorr" \
--exclude "fsl/bin/smoothest" \
--exclude "fsl/bin/calc_grad_perc_dev" \
--exclude "fsl/bin/avscale" \
--exclude "fsl/bin/make_dyadic_vectors" \
--exclude "fsl/binfslpspec" \
--exclude "fsl/bin/susan" \
--exclude "fsl/binfslfft" \
--exclude "fsl/bin/unconfound" \
--exclude "fsl/bin/rmsdiff" \
&& find /opt/fsl-6.0.5.1/data/standard -type f -not -name "MNI152_T1_2mm_brain.nii.gz" -delete
&& curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" \
| tar -xzpf - fsl-6.0.5.1-centos7_64.tar.gz -O | tar -xzpC /opt/fsl-6.0.5.1 --no-same-owner --strip-components 1

ENV FSLDIR="/opt/fsl-6.0.5.1" \
PATH="/opt/fsl-6.0.5.1/bin:$PATH" \
PATH="/opt/afni-latest:/opt/ants:/opt/fsl-6.0.5.1/bin:$PATH" \
FSLOUTPUTTYPE="NIFTI_GZ" \
FSLMULTIFILEQUIT="TRUE" \
FSLLOCKDIR="" \
FSLMACHINELIST="" \
FSLREMOTECALL="" \
FSLGECUDAQ="cuda.q" \
LD_LIBRARY_PATH="/opt/fsl-6.0.5.1/lib:$LD_LIBRARY_PATH"

ENV PATH="/opt/afni-latest:$PATH" \
LD_LIBRARY_PATH="/opt/fsl-6.0.5.1/lib:$LD_LIBRARY_PATH" \
AFNI_IMSAVE_WARNINGS="NO" \
AFNI_PLUGINPATH="/opt/afni-latest"

# Installing ANTs 2.3.3 (NeuroDocker build)
# Note: the URL says 2.3.4 but it is actually 2.3.3
ENV ANTSPATH="/opt/ants" \
PATH="/opt/ants:$PATH"
WORKDIR $ANTSPATH
RUN curl -sSL --retry 5 "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
| tar -xzC $ANTSPATH --strip-components 1
RUN mkdir -p /opt/ants \
&& curl -sSL --retry 5 "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
| tar -xzC /opt/ants --strip-components 1

# Create a shared $HOME directory
RUN useradd -m -s /bin/bash -G users -u 1000 bibsnet
Expand All @@ -205,24 +85,20 @@ RUN cd /home/bibsnet && \
pip install -e .

#ENV nnUNet_raw_data_base="/output"
ENV nnUNet_preprocessed="/opt/nnUNet/nnUNet_raw_data_base/nnUNet_preprocessed"
ENV RESULTS_FOLDER="/opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models"
ENV nnUNet_preprocessed="/opt/nnUNet/nnUNet_raw_data_base/nnUNet_preprocessed" \
RESULTS_FOLDER="/opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models"

RUN mkdir -p /opt/nnUNet/nnUNet_raw_data_base/ /opt/nnUNet/nnUNet_raw_data_base/nnUNet_preprocessed /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet /home/bibsnet/data
#COPY trained_models/Task512_BCP_ABCD_Neonates_SynthSegDownsample.zip /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet
RUN curl -sSL "https://s3.msi.umn.edu/cabinet-data-targz/Task552_uniform_distribution_synthseg.tar.gz" | tar -xzC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1 && \
curl -sSL "https://s3.msi.umn.edu/cabinet-data-targz/Task514_BCP_ABCD_Neonates_SynthSeg_T1Only.tar.gz" | tar -xzC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1 && \
curl -sSL "https://s3.msi.umn.edu/cabinet-data-targz/Task515_BCP_ABCD_Neonates_SynthSeg_T2Only.tar.gz" | tar -xzC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1

RUN curl -sSL "https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz" \
| tar -xzC $ANTSPATH --strip-components 1
RUN curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" | tar -xzpf - Task552_uniform_distribution_synthseg.tar.gz -O | tar -xzpC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1 && \
curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" | tar -xzpf - Task514_BCP_ABCD_Neonates_SynthSeg_T1Only.tar.gz -O | tar -xzpC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1 &&\
curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" | tar -xzpf - Task515_BCP_ABCD_Neonates_SynthSeg_T2Only.tar.gz -O | tar -xzpC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1 && \
curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" | tar -xzpf - Task526_BIBSNet_Production_Model.tar.gz -O | tar -xzpC /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet --no-same-owner --strip-components 1

COPY run.py /home/bibsnet/run.py
COPY src /home/bibsnet/src
RUN chmod 777 -R /opt/fsl-6.0.5.1
RUN bash /home/bibsnet/src/fixpy.sh /opt/fsl-6.0.5.1
COPY bin /home/bibsnet/bin
RUN curl -sSL "https://s3.msi.umn.edu/cabinet-data-targz/data.tar.gz" | tar -xzC /home/bibsnet/data --no-same-owner --strip-components 1
RUN curl -sSL "https://s3.msi.umn.edu/bibsnet-data/bibsnet-v3.2.0.tar.gz" | tar -xzpf - data.tar.gz -O | tar -xzpC /home/bibsnet/data --no-same-owner --strip-components 1

COPY requirements.txt /home/bibsnet/requirements.txt

Expand All @@ -231,8 +107,6 @@ ENV PATH="${PATH}:/home/bibsnet/"
RUN cp /home/bibsnet/run.py /home/bibsnet/bibsnet

RUN cd /home/bibsnet/ && pip install -r requirements.txt
RUN cd /home/bibsnet/ && chmod 555 -R run.py bin src bibsnet data
RUN chmod -R a+r /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet/3d_fullres
RUN find /opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet/3d_fullres -type f -name 'postprocessing.json' -exec chmod 666 {} \;
RUN cd /home/bibsnet/ && chmod 555 -R run.py bin src bibsnet

ENTRYPOINT ["bibsnet"]
13 changes: 0 additions & 13 deletions data/dataset_description.json

This file was deleted.

6 changes: 0 additions & 6 deletions data/models.csv

This file was deleted.

16 changes: 0 additions & 16 deletions data/sidecar_template.json

This file was deleted.

5 changes: 0 additions & 5 deletions docs/comingsoon.md

This file was deleted.

3 changes: 2 additions & 1 deletion docs/stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Quickly and accurately segments an optimally-aligned T1 and T2 pair with a deep

| Model | Description |
|:-:|:--|
| 552 | Default T1w and T2w model |
| 514 | Default T1w-only model |
| 515 | Default T2w-only model |
| 526 | Default T1w and T2w model |
| 552 | Old T1w and T2w model |

<br />

Expand Down
35 changes: 26 additions & 9 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ usage: BIBSnet [-h] [-participant PARTICIPANT_LABEL] [-age AGE_MONTHS]
[--fsl-bin-path FSL_BIN_PATH] [-jargs PARAMETER_JSON]
[-model MODEL] [--nnUNet NNUNET]
[--nnUNet-configuration {2d,3d_fullres,3d_lowres,3d_cascade_fullres}]
[--overwrite] [-ses SESSION]
[-start {prebibsnet,bibsnet,postbibsnet}] [-w WORK_DIR] [-z]
[--script-dir SCRIPT_DIR] [-v | -d]
[--overwrite] [--reduce-cropping [REDUCE_CROPPING]]
[-ses SESSION] [-start {prebibsnet,bibsnet,postbibsnet}]
[-w WORK_DIR] [-z] [-v | -d]
bids_dir output_dir {participant}
positional arguments:
Expand Down Expand Up @@ -55,7 +55,7 @@ optional arguments:
be inferred from /home/bibsnet/data/models.csv based
on which data exists in the --bids-dir. BIBSnet will
run model 514 by default for T1w-only, model 515 for
T2w-only, and model 552 for both T1w and T2w.
T2w-only, and model 526 for both T1w and T2w.
--nnUNet NNUNET, -n NNUNET
Valid path to existing executable file to run nnU-
Net_predict. By default, this script will assume that
Expand All @@ -69,6 +69,22 @@ optional arguments:
by default BIBSnet will skip creating any BIBSnet
output files that already exist in the sub-directories
of derivatives.
--reduce-cropping [REDUCE_CROPPING]
This flag is used to specify a value by which to
increase or decrease the brain z size used by FSL
robustfov for cropping. This is useful for cases where
the default age-specific brain z size specified by
BIBSNet (calculated based on a table within the
container of BCP participants' average head radius per
age: data/age_to_avg_head_radius_BCP.csv) results in
overcropping. The brain z size can be adjusted by a
specified amount by including an integer with this
flag [REDUCE_CROPPING]: positive integers will
increase brain z size to crop less and negative
integers will decrease brain z size to crop more.
Default: Include this flag by itself to increase the
brain z size and therefore reduce cropping by 20
millimeters.
-ses SESSION, --session SESSION, --session-id SESSION
The name of the session to processes participant data
for. Example: baseline_year1
Expand All @@ -84,10 +100,6 @@ optional arguments:
brain_z_size column.Otherwise, BIBSnet will estimate
the brain height from the participant age and averages
of a large sample of infant brain heights.
--script-dir SCRIPT_DIR
Valid path to the existing parent directory of this
run.py script. Include this argument if and only if
you are running the script as a SLURM/SBATCH job.
-v, --verbose Include this flag to print detailed information and
every command being run by BIBSnet to stdout.
Otherwise BIBSnet will only print warnings, errors,
Expand Down Expand Up @@ -129,12 +141,17 @@ This has been primarily tested in Singularity. We are less able to provide techn
We do not recommend running `BIBSnet` outside of the container for the following reasons:

1. Installing nnU-Net can be complicated.

1. Running `BIBSnet` inside the container ensures you have the proper versions of all software.

1. It is hard to diagnose your errors if you are working in a different environment.

However, if you run `BIBSnet` outside of the container as an application, then you will need to do the following:

1. Download the `data` directory from the `https://s3.msi.umn.edu/CABINET_data/data.zip` URL, unzip it, and move it into your cloned `BIBSnet` repository directory here: `BIBSnet/data/`
1. Download the appropriate data release from `https://s3.msi.umn.edu/bibsnet-data/<DATA_RELEASE>.tar.gz`

1. Extract `data.tar.gz` then extract all files in it and move them into your cloned `BIBSnet` repository directory here: `BIBSnet/data/`

1. Install [nnU-Net](https://github.com/MIC-DKFZ/nnUNet#installation)

<br />
13 changes: 6 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ plugins:
docs_dir: docs
nav:
- 1. Overview: index.md
- 2. Coming Soon: comingsoon.md
- 3. Installation: installation.md
- 4. Usage: usage.md
- 5. Participant and Sessions TSV Requirements: participants.md
- 6. Stages: stages.md
- 7. Outputs: outputs.md
- 8. Contributions: contributions.md
- 2. Installation: installation.md
- 3. Usage: usage.md
- 4. Participant and Sessions TSV Requirements: participants.md
- 5. Stages: stages.md
- 6. Outputs: outputs.md
- 7. Contributions: contributions.md

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nibabel==3.2.1
nipype==1.8.6
pandas==1.3.5
scipy==1.8.0
scipy==1.10.0
niworkflows==1.9.0
11 changes: 0 additions & 11 deletions src/fixpy.sh

This file was deleted.

Loading

0 comments on commit 8c7538c

Please sign in to comment.