From f49345e5b658408c7467edf45563c874b7fb1a18 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Thu, 3 Oct 2019 10:47:49 -0400 Subject: [PATCH] ADD: mricron (#300) * add mricron pre-compiled * add latest compiled version * add examples for mricron --- README.md | 2 ++ examples/README.md | 8 ++++++++ neurodocker/interfaces/interfaces.py | 10 ++++++++++ neurodocker/neurodocker.py | 3 +++ neurodocker/templates/mricron.yaml | 28 ++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 neurodocker/templates/mricron.yaml diff --git a/README.md b/README.md index fe464ef8..40f68a15 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,8 @@ Note: it is not yet possible to minimize Docker containers using the _Neurodocke | | conda_install | Packages to install with `conda`. E.g., `conda_install="python=3.6 numpy traits"` | | | pip_install | Packages to install with `pip`. | | | activate | If true (default), activate this environment in container entrypoint. | +| **MRIcron** | version\* | latest, 1.0.20190902, 1.0.20190410, 1.0.20181114, 1.0.20180614, 1.0.20180404, 1.0.20171220 | +| | install_path | Installation path. Default `/opt/mricron-{version}` | | **MRtrix3** | version\* | 3.0 | | | method | binaries (default) | | | install_path | Installation path. Default `/opt/mrtrix3-{version}`. | diff --git a/examples/README.md b/examples/README.md index 73ff1023..b0560c2a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -30,6 +30,7 @@ All of the examples below use `debian:stretch` as the base image, but any Docker - [Matlab Compiler Runtime (MCR)](#matlab-compiler-runtime-mcr) - [MINC](#minc) - [Miniconda](#miniconda) + - [MRIcron](#mricron) - [MRtrix3](#mrtrix3) - [NeuroDebian](#neurodebian) - [PETPVC](#petpvc) @@ -318,6 +319,13 @@ neurodocker generate [docker|singularity] --base=debian:stretch --pkg-manager=ap yaml_file=/opt/environment.yml ``` +## MRIcron + +```shell +neurodocker generate [docker|singularity] --base=debian:stretch --pkg-manager=apt \ + --mricron version=latest +``` + ## MRtrix3 ```shell diff --git a/neurodocker/interfaces/interfaces.py b/neurodocker/interfaces/interfaces.py index 92697bae..af6108b9 100644 --- a/neurodocker/interfaces/interfaces.py +++ b/neurodocker/interfaces/interfaces.py @@ -249,6 +249,16 @@ def render_env(self): return super().render_env() +class MINC(_BaseInterface): + """Create instance of MRIcron object.""" + + _name = 'mricron' + _pretty_name = 'MRIcron' + + def __init__(self, *args, **kwargs): + super().__init__(self._name, *args, **kwargs) + + class MRtrix3(_BaseInterface): """Create instance of MRtrix3 object.""" diff --git a/neurodocker/neurodocker.py b/neurodocker/neurodocker.py index 9e5ed0cb..6fbfcf87 100644 --- a/neurodocker/neurodocker.py +++ b/neurodocker/neurodocker.py @@ -161,6 +161,9 @@ def _add_generate_common_arguments(parser): " (defaults to latest). The options conda_install and" " pip_install accept strings of packages: conda_install=" '"python=3.6 numpy traits".', + "mricron": + "Install MRIcron. valid keys are version (required), method, and" + " install_path.", "mrtrix3": "Install MRtrix3. Valid keys are version (required)," " method, and install_path", diff --git a/neurodocker/templates/mricron.yaml b/neurodocker/templates/mricron.yaml new file mode 100644 index 00000000..e2a92d89 --- /dev/null +++ b/neurodocker/templates/mricron.yaml @@ -0,0 +1,28 @@ +# Instructions to install MRIcron. +# +# Repository: https://github.com/neurolabusc/MRIcron + +generic: + binaries: + urls: + latest: https://github.com/neurolabusc/MRIcron/releases/latest/download/MRIcron_linux.zip + "1.0.20190902": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20190902/MRIcron_linux.zip + "1.0.20190410": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20190410/mricron_linux.zip + "1.0.20181114": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20181114/mricron_linux.zip + "1.0.20180614": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20180614/mricron_linux.zip + "1.0.20180404": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20180404/mricron_lx64.zip + "1.0.20171220": https://github.com/neurolabusc/MRIcron/releases/download/v1.0.20171220/mricron_linux.zip + dependencies: + apt: libgtk2.0-0 + yum: gtk2 + env: + PATH: "{{ mricron.install_path }}:$PATH" + instructions: | + {{ mricron.install_dependencies() }} + echo "Downloading MRIcron ..." + mkdir -p {{ mricron.install_path }} + curl {{ mricron.curl_opts }} -O {{ mricron.binaries_url }} + unzip "*cron*.zip" + rm -f "*cron*.zip" + mv mricron/* {{ mricron.install_path }} + rmdir mricron