Skip to content

Commit 018048a

Browse files
committed
Merge branch 'rel-v0.5.2' into debian
* rel-v0.5.2: (52 commits) Version boost CHANGELOG adding pandas to docker file generation adding the string check back replacing clumsy typecheck with kwargs Update heudiconv/utils.py RF: extracted functionality into a dedicated populate_aggregated_jsons rescuing files for git annex Delete environment27.yml Delete .projectignore added anon-cmd unit test. verified in py36 and py27 passes unit test in boty py3.6 and py 2.7 undoing to start from base just stash handling of variable returned by subprocess more robust to different string types added subproces string decoding for anonymization use Do regenerate top level task-* stab file, retain only our custom fields RF: removed unused imports enh: wrap conda and pip pkgs in single quotes fix: add "recommended" package ...
2 parents a3a9297 + ad63f7d commit 018048a

30 files changed

+589
-336
lines changed

.coveragerc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[run]
2-
include = tests/*
3-
heudiconv/*
2+
include = heudiconv/*
43
setup.py

.gitignore

100644100755
File mode changed.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ install:
3737
- git config --global user.name "Travis Almighty"
3838

3939
script:
40-
- coverage run `which py.test` -s -v tests heudiconv/heuristics/*.py
40+
- coverage run `which py.test` -s -v heudiconv
4141

4242
after_success:
4343
- codecov

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@ All notable changes to this project will be documented (for humans) in this file
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.5.2] - 2019-01-04
8+
9+
A variety of bugfixes
10+
11+
### Added
12+
### Changed
13+
14+
- Reproin heuristic: `__dup` indices would now be assigned incrementally
15+
individually per each sequence, so there is a chance to properly treat
16+
associate for multi-file (e.g. `fmap`) sequences
17+
- Reproin heuristic: also split StudyDescription by space not only by ^
18+
- `tests/` moved under `heudiconv/tests` to ease maintenance and facilitate
19+
testing of an installed heudiconv
20+
- Protocol name will also be accessed from private Siemens
21+
csa.tProtocolName header field if not present in public one
22+
23+
### Deprecated
24+
### Fixed
25+
26+
- Multiple files produced by dcm2niix are first sorted to guarantee
27+
correct order e.g. of magnitude files in fieldmaps, which otherwise
28+
resulted in incorrect according to BIDS ordering of them
29+
- Aggregated top level .json files now would contain only the fields
30+
with the same values from all scanned files. In prior versions,
31+
those files were not regenerated after an initial conversion
32+
33+
### Removed
34+
### Security
35+
36+
737
## [0.5.1] - 2018-07-05
838
Bugfix release
939

Dockerfile

Lines changed: 97 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,134 @@
1-
# Generated by Neurodocker v0.3.2.
2-
#
1+
# Generated by Neurodocker version 0.4.2-3-gf7055a1
2+
# Timestamp: 2018-11-13 22:04:04 UTC
3+
#
34
# Thank you for using Neurodocker. If you discover any issues
45
# or ways to improve this software, please submit an issue or
56
# pull request on our GitHub repository:
7+
#
68
# https://github.com/kaczmarj/neurodocker
7-
#
8-
# Timestamp: 2018-06-29 18:14:08
99

10-
FROM debian:stretch
10+
FROM neurodebian:stretch
1111

12-
ARG DEBIAN_FRONTEND=noninteractive
12+
ARG DEBIAN_FRONTEND="noninteractive"
1313

14-
#----------------------------------------------------------
15-
# Install common dependencies and create default entrypoint
16-
#----------------------------------------------------------
1714
ENV LANG="en_US.UTF-8" \
18-
LC_ALL="C.UTF-8" \
15+
LC_ALL="en_US.UTF-8" \
1916
ND_ENTRYPOINT="/neurodocker/startup.sh"
20-
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
21-
apt-utils bzip2 ca-certificates curl locales unzip \
17+
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
18+
&& apt-get update -qq \
19+
&& apt-get install -y -q --no-install-recommends \
20+
apt-utils \
21+
bzip2 \
22+
ca-certificates \
23+
curl \
24+
locales \
25+
unzip \
2226
&& apt-get clean \
2327
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
24-
&& localedef --force --inputfile=en_US --charmap=UTF-8 C.UTF-8 \
28+
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
29+
&& dpkg-reconfigure --frontend=noninteractive locales \
30+
&& update-locale LANG="en_US.UTF-8" \
2531
&& chmod 777 /opt && chmod a+s /opt \
2632
&& mkdir -p /neurodocker \
2733
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
28-
echo '#!/usr/bin/env bash' >> $ND_ENTRYPOINT \
29-
&& echo 'set +x' >> $ND_ENTRYPOINT \
30-
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \
31-
fi \
34+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
35+
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
36+
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
37+
fi \
3238
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
39+
3340
ENTRYPOINT ["/neurodocker/startup.sh"]
3441

35-
#------------------------
36-
# Install dcm2niix v1.0.20180622
37-
#------------------------
38-
WORKDIR /tmp
39-
RUN deps='cmake g++ gcc git make pigz zlib1g-dev' \
40-
&& apt-get update -qq && apt-get install -yq --no-install-recommends $deps \
42+
ENV PATH="/opt/dcm2niix-v1.0.20180622/bin:$PATH"
43+
RUN apt-get update -qq \
44+
&& apt-get install -y -q --no-install-recommends \
45+
cmake \
46+
g++ \
47+
gcc \
48+
git \
49+
make \
50+
pigz \
51+
zlib1g-dev \
4152
&& apt-get clean \
4253
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
43-
&& mkdir dcm2niix \
44-
&& curl -sSL https://github.com/rordenlab/dcm2niix/tarball/v1.0.20180622 | tar xz -C dcm2niix --strip-components 1 \
45-
&& mkdir dcm2niix/build && cd dcm2niix/build \
46-
&& cmake .. && make \
54+
&& git clone https://github.com/rordenlab/dcm2niix /tmp/dcm2niix \
55+
&& cd /tmp/dcm2niix \
56+
&& git fetch --tags \
57+
&& git checkout v1.0.20180622 \
58+
&& mkdir /tmp/dcm2niix/build \
59+
&& cd /tmp/dcm2niix/build \
60+
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/dcm2niix-v1.0.20180622 .. \
61+
&& make \
4762
&& make install \
48-
&& rm -rf /tmp/* \
49-
&& apt-get purge -y --auto-remove $deps
50-
51-
#--------------------------------------------------
52-
# Add NeuroDebian repository
53-
# Please note that some packages downloaded through
54-
# NeuroDebian may have restrictive licenses.
55-
#--------------------------------------------------
56-
RUN apt-get update -qq && apt-get install -yq --no-install-recommends dirmngr gnupg \
57-
&& apt-get clean \
58-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
59-
&& curl -sSL http://neuro.debian.net/lists/stretch.us-nh.full \
60-
> /etc/apt/sources.list.d/neurodebian.sources.list \
61-
&& curl -sSL https://dl.dropbox.com/s/zxs209o955q6vkg/neurodebian.gpg \
62-
| apt-key add - \
63-
&& (apt-key adv --refresh-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 || true) \
64-
&& apt-get update
65-
66-
# Install NeuroDebian packages
67-
RUN apt-get update -qq && apt-get install -yq --no-install-recommends git-annex-standalone \
68-
&& apt-get clean \
69-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
63+
&& rm -rf /tmp/dcm2niix
7064

7165
RUN apt-get update -qq \
72-
&& apt-get install -y -q --no-install-recommends git \
73-
gcc \
74-
pigz \
66+
&& apt-get install -y -q --no-install-recommends \
67+
git \
68+
gcc \
69+
pigz \
70+
liblzma-dev \
71+
libc-dev \
72+
git-annex-standalone \
73+
netbase \
7574
&& apt-get clean \
7675
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7776

7877
COPY [".", "/src/heudiconv"]
7978

80-
#------------------
81-
# Install Miniconda
82-
#------------------
83-
ENV CONDA_DIR=/opt/conda \
84-
PATH=/opt/conda/bin:$PATH
85-
RUN echo "Downloading Miniconda installer ..." \
86-
&& miniconda_installer=/tmp/miniconda.sh \
87-
&& curl -sSL --retry 5 -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
88-
&& /bin/bash $miniconda_installer -b -p $CONDA_DIR \
89-
&& rm -f $miniconda_installer \
79+
ENV CONDA_DIR="/opt/miniconda-latest" \
80+
PATH="/opt/miniconda-latest/bin:$PATH"
81+
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
82+
&& echo "Downloading Miniconda installer ..." \
83+
&& conda_installer="/tmp/miniconda.sh" \
84+
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
85+
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
86+
&& rm -f "$conda_installer" \
87+
&& conda update -yq -nbase conda \
9088
&& conda config --system --prepend channels conda-forge \
9189
&& conda config --system --set auto_update_conda false \
9290
&& conda config --system --set show_channel_urls true \
93-
&& conda clean -tipsy && sync
94-
95-
#-------------------------
96-
# Create conda environment
97-
#-------------------------
98-
RUN conda create -y -q --name neuro python=2 \
99-
traits=4.6.0 \
10091
&& sync && conda clean -tipsy && sync \
101-
&& /bin/bash -c "source activate neuro \
102-
&& pip install -q --no-cache-dir https://github.com/moloney/dcmstack/tarball/master \
103-
/src/heudiconv[all]" \
104-
&& sync \
105-
&& sed -i '$isource activate neuro' $ND_ENTRYPOINT
92+
&& conda install -y -q --name base \
93+
'python=3.6' \
94+
'traits>=4.6.0' \
95+
'scipy' \
96+
'numpy' \
97+
'pandas' \
98+
'nomkl' \
99+
&& sync && conda clean -tipsy && sync \
100+
&& bash -c "source activate base \
101+
&& pip install --no-cache-dir --editable \
102+
'/src/heudiconv[all]'" \
103+
&& rm -rf ~/.cache/pip/* \
104+
&& sync
106105

107-
ENTRYPOINT ["/neurodocker/startup.sh", "heudiconv"]
106+
ENTRYPOINT ["heudiconv"]
108107

109-
#--------------------------------------
110-
# Save container specifications to JSON
111-
#--------------------------------------
112108
RUN echo '{ \
113109
\n "pkg_manager": "apt", \
114-
\n "check_urls": true, \
115110
\n "instructions": [ \
116111
\n [ \
117112
\n "base", \
118-
\n "debian:stretch" \
113+
\n "neurodebian:stretch" \
119114
\n ], \
120115
\n [ \
121116
\n "dcm2niix", \
122117
\n { \
123-
\n "version": "v1.0.20180622" \
124-
\n } \
125-
\n ], \
126-
\n [ \
127-
\n "neurodebian", \
128-
\n { \
129-
\n "os_codename": "stretch", \
130-
\n "download_server": "usa-nh", \
131-
\n "pkgs": "git-annex-standalone" \
118+
\n "version": "v1.0.20180622", \
119+
\n "method": "source" \
132120
\n } \
133121
\n ], \
134122
\n [ \
135123
\n "install", \
136124
\n [ \
137125
\n "git", \
138126
\n "gcc", \
139-
\n "pigz" \
127+
\n "pigz", \
128+
\n "liblzma-dev", \
129+
\n "libc-dev", \
130+
\n "git-annex-standalone", \
131+
\n "netbase" \
140132
\n ] \
141133
\n ], \
142134
\n [ \
@@ -149,17 +141,24 @@ RUN echo '{ \
149141
\n [ \
150142
\n "miniconda", \
151143
\n { \
152-
\n "env_name": "neuro", \
153-
\n "conda_install": "python=2 traits=4.6.0", \
154-
\n "activate": true, \
155-
\n "pip_install": "https://github.com/moloney/dcmstack/tarball/master /src/heudiconv[all]" \
144+
\n "use_env": "base", \
145+
\n "conda_install": [ \
146+
\n "python=3.6", \
147+
\n "traits>=4.6.0", \
148+
\n "scipy", \
149+
\n "numpy", \
150+
\n "pandas", \
151+
\n "nomkl" \
152+
\n ], \
153+
\n "pip_install": [ \
154+
\n "/src/heudiconv[all]" \
155+
\n ], \
156+
\n "pip_opts": "--editable" \
156157
\n } \
157158
\n ], \
158159
\n [ \
159160
\n "entrypoint", \
160-
\n "/neurodocker/startup.sh heudiconv" \
161+
\n "heudiconv" \
161162
\n ] \
162-
\n ], \
163-
\n "generation_timestamp": "2018-06-29 18:14:08", \
164-
\n "neurodocker_version": "0.3.2" \
163+
\n ] \
165164
\n}' > /neurodocker/neurodocker_specs.json

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright [2014-2018] [Heudiconv developers]
1+
Copyright [2014-2019] [Heudiconv developers]
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)