Skip to content

Commit

Permalink
ants.LaplacianThickness with a set of tests which demonstrate the pro…
Browse files Browse the repository at this point in the history
…blem of positional args

see e.g. nipy/nipype#2848
  • Loading branch information
yarikoptic committed Jan 25, 2019
1 parent d65e0d3 commit de68c01
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 27 deletions.
30 changes: 17 additions & 13 deletions gears/nipype/ants/segmentation/LaplacianThickness/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
FROM neurodebian:stretch
FROM neurodebian:stretch-non-free
MAINTAINER Yaroslav O. Halchenko <[email protected]>

# TODO: use snapshots for reproducible image!
# Install additional APT mirror for NeuroDebian for better availability/resilience
RUN echo deb http://neurodeb.pirsquared.org data main contrib non-free >> /etc/apt/sources.list.d/neurodebian.sources.list
RUN echo deb http://neurodeb.pirsquared.org stretch main contrib non-free >> /etc/apt/sources.list.d/neurodebian.sources.list
# Make image reproducible based on the date/state of things in Debian/NeuroDebian
# land.
# Time format yyyymmdd
RUN nd_freeze 20181221

# To prevent interactive debconf during installations
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y eatmydata

# Make directory for flywheel spec (v0)
# TODO: gearificator prepare-docker recipename_or_url
# cons: would somewhat loose cached steps (pre-installation, etc)
# For now -- entire manual template
RUN eatmydata apt-get update && echo "count 1" && \
eatmydata apt-get install -y --no-install-recommends python-pip python-nipype
RUN apt-get update && echo "count 1" \
&& apt-get install -y --no-install-recommends python-pip python-nipype \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Download/Install gearificator suite
# TODO install git if we do via git
RUN eatmydata apt-get install -y git python-setuptools
RUN apt-get update \
&& apt-get install -y git python-setuptools \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# TEMPMOVE RUN git clone git://github.com/yarikoptic/gearificator /srv/gearificator && echo 7
# TEMPMOVE RUN pip install -e /srv/gearificator

Expand All @@ -32,12 +33,15 @@ RUN mkdir -p ${FLYWHEEL}
ENV LC_ALL C.UTF-8

# Now we do this particular Gear specific installations
RUN eatmydata apt-get install -y --no-install-recommends python-nipype ants
RUN apt-get clean

RUN apt-get update \
&& apt-get install -y --no-install-recommends python-nipype ants \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN pip install && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN git clone git://github.com/yarikoptic/gearificator /srv/gearificator && echo 7
RUN pip install -e /srv/gearificator
RUN pip install -e /srv/gearificator && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY run ${FLYWHEEL}/run
COPY manifest.json ${FLYWHEEL}/manifest.json
Expand Down
28 changes: 14 additions & 14 deletions gears/nipype/ants/segmentation/LaplacianThickness/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Yaroslav O. Halchenko",
"maintainer": "Yaroslav O. Halchenko <[email protected]>",
"license": "BSD-3-Clause",
"version": "0.1.dev.nipype.1.0.3.3",
"version": "0.2.dev1.nipype.1.1.8.g597c03f64",
"config": {
"num_threads": {
"type": "integer",
Expand All @@ -18,27 +18,27 @@
},
"dT": {
"type": "number",
"description": "Dt",
"optional": true
},
"opt_tolerance": {
"type": "number",
"description": "Opt tolerance",
"description": "Time delta used during integration (defaults to 0.01)",
"optional": true
},
"prior_thickness": {
"type": "number",
"description": "Prior thickness",
"description": "Prior thickness (defaults to 500)",
"optional": true
},
"smooth_param": {
"type": "number",
"description": "Smooth param",
"description": "Sigma of the Laplacian Recursive Image Filter (defaults to 1)",
"optional": true
},
"sulcus_prior": {
"type": "boolean",
"description": "Sulcus prior",
"type": "number",
"description": "Positive floating point number for sulcus prior. Authors said that 0.15 might be a reasonable value",
"optional": true
},
"tolerance": {
"type": "number",
"description": "Tolerance to reach during optimization (defaults to 0.001)",
"optional": true
}
},
Expand All @@ -57,7 +57,7 @@
"base": "file"
}
},
"url": "http://nipype.readthedocs.io/en/1.0.3/interfaces/generated/interfaces.ants/registration.html",
"url": "http://nipype.readthedocs.io/en/1.1.8-dev+g597c03f64/interfaces/generated/interfaces.ants/registration.html",
"source": "https://github.com/yarikoptic/gearificator",
"custom": {
"gearificator": {
Expand All @@ -73,9 +73,9 @@
"suite": "ANTS 2"
},
"gear-builder": {
"image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.1.dev.nipype.1.0.3.3"
"image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.2.dev1.nipype.1.1.8.g597c03f64"
},
"docker-image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.1.dev.nipype.1.0.3.3"
"docker-image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.2.dev1.nipype.1.1.8.g597c03f64"
},
"label": "LaplacianThickness"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
inputs:
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
config:
smooth_param: 1
prior_thickness: 500
dT: 0.01
# sulcus prior by default is not "engaged"
sulcus_prior: 0
tolerance: 0.001
# This one should produce results identical to simple1, just different output filename
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
inputs:
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
config:
# this one to verify that it doesn't stick it into smooth_param which is positional before it
prior_thickness: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
inputs:
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
config:
# this and defaults test should wait for ... to be released
smooth_param: 3

0 comments on commit de68c01

Please sign in to comment.