Skip to content

Commit de68c01

Browse files
committed
ants.LaplacianThickness with a set of tests which demonstrate the problem of positional args
see e.g. nipy/nipype#2848
1 parent d65e0d3 commit de68c01

File tree

7 files changed

+56
-27
lines changed

7 files changed

+56
-27
lines changed

gears/nipype/ants/segmentation/LaplacianThickness/Dockerfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
FROM neurodebian:stretch
1+
FROM neurodebian:stretch-non-free
22
MAINTAINER Yaroslav O. Halchenko <debian@onerussian.com>
33

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

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

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

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

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

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

37+
RUN apt-get update \
38+
&& apt-get install -y --no-install-recommends python-nipype ants \
39+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
40+
41+
RUN pip install && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3842

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

4246
COPY run ${FLYWHEEL}/run
4347
COPY manifest.json ${FLYWHEEL}/manifest.json

gears/nipype/ants/segmentation/LaplacianThickness/manifest.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Yaroslav O. Halchenko",
55
"maintainer": "Yaroslav O. Halchenko <debian@onerussian.com>",
66
"license": "BSD-3-Clause",
7-
"version": "0.1.dev.nipype.1.0.3.3",
7+
"version": "0.2.dev1.nipype.1.1.8.g597c03f64",
88
"config": {
99
"num_threads": {
1010
"type": "integer",
@@ -18,27 +18,27 @@
1818
},
1919
"dT": {
2020
"type": "number",
21-
"description": "Dt",
22-
"optional": true
23-
},
24-
"opt_tolerance": {
25-
"type": "number",
26-
"description": "Opt tolerance",
21+
"description": "Time delta used during integration (defaults to 0.01)",
2722
"optional": true
2823
},
2924
"prior_thickness": {
3025
"type": "number",
31-
"description": "Prior thickness",
26+
"description": "Prior thickness (defaults to 500)",
3227
"optional": true
3328
},
3429
"smooth_param": {
3530
"type": "number",
36-
"description": "Smooth param",
31+
"description": "Sigma of the Laplacian Recursive Image Filter (defaults to 1)",
3732
"optional": true
3833
},
3934
"sulcus_prior": {
40-
"type": "boolean",
41-
"description": "Sulcus prior",
35+
"type": "number",
36+
"description": "Positive floating point number for sulcus prior. Authors said that 0.15 might be a reasonable value",
37+
"optional": true
38+
},
39+
"tolerance": {
40+
"type": "number",
41+
"description": "Tolerance to reach during optimization (defaults to 0.001)",
4242
"optional": true
4343
}
4444
},
@@ -57,7 +57,7 @@
5757
"base": "file"
5858
}
5959
},
60-
"url": "http://nipype.readthedocs.io/en/1.0.3/interfaces/generated/interfaces.ants/registration.html",
60+
"url": "http://nipype.readthedocs.io/en/1.1.8-dev+g597c03f64/interfaces/generated/interfaces.ants/registration.html",
6161
"source": "https://github.com/yarikoptic/gearificator",
6262
"custom": {
6363
"gearificator": {
@@ -73,9 +73,9 @@
7373
"suite": "ANTS 2"
7474
},
7575
"gear-builder": {
76-
"image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.1.dev.nipype.1.0.3.3"
76+
"image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.2.dev1.nipype.1.1.8.g597c03f64"
7777
},
78-
"docker-image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.1.dev.nipype.1.0.3.3"
78+
"docker-image": "gearificator/nipype-interfaces-ants-segmentation-laplacianthickness:0.2.dev1.nipype.1.1.8.g597c03f64"
7979
},
8080
"label": "LaplacianThickness"
8181
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
inputs:
2+
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
3+
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
4+
config:
5+
smooth_param: 1
6+
prior_thickness: 500
7+
dT: 0.01
8+
# sulcus prior by default is not "engaged"
9+
sulcus_prior: 0
10+
tolerance: 0.001
11+
# This one should produce results identical to simple1, just different output filename
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../simple1/gfoutput.nii.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
inputs:
2+
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
3+
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
4+
config:
5+
# this one to verify that it doesn't stick it into smooth_param which is positional before it
6+
prior_thickness: 3
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
inputs:
2+
input_gm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors2.nii.gz
3+
input_wm: antsCorticalThicknessExample/ResultsT1Only/exampleBrainSegmentationPosteriors3.nii.gz
4+
config:
5+
# this and defaults test should wait for ... to be released
6+
smooth_param: 3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../.git/annex/objects/Zg/WW/MD5E-s24108--e48f2324c36819b02b5215420b798667.nii.gz/MD5E-s24108--e48f2324c36819b02b5215420b798667.nii.gz

0 commit comments

Comments
 (0)