Skip to content

Commit 81bcf41

Browse files
authored
Merge pull request #2464 from kaczmarj/docs/neurodocker
DOCS: add brief neurodocker tutorial
2 parents 1ecd0ff + 25697ad commit 81bcf41

File tree

3 files changed

+121
-5
lines changed

3 files changed

+121
-5
lines changed

doc/links_names.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
.. _EPD: http://www.enthought.com/products/epd.php
7676
.. _Traits: http://code.enthought.com/projects/traits/
7777
.. _Miniconda: https://conda.io/miniconda.html
78+
.. _neurodocker: https://github.com/kaczmarj/neurodocker
7879

7980
.. Python imaging projects
8081
.. _PyMVPA: http://www.pymvpa.org
@@ -105,6 +106,7 @@
105106
.. _macports: http://www.macports.org/
106107
.. _Vagrant: http://www.vagrantup.com/
107108
.. _Docker: http://www.docker.io/
109+
.. _Singularity: http://singularity.lbl.gov/
108110
.. _Virtualbox: https://www.virtualbox.org/
109111

110112
.. Functional imaging labs

doc/users/install.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ This page covers the necessary steps to install Nipype.
99
Using docker
1010
~~~~~~~~~~~~
1111

12-
You can follow the `Nipype tutorial <https://miykael.github.io/nipype_tutorial/>`_
12+
To get started using Docker, you can follow the `Nipype tutorial
13+
<https://miykael.github.io/nipype_tutorial/>`_, or pull the `nipype/nipype`
14+
image from Docker hub::
1315

14-
or use this docker container: `docker pull nipype/nipype`
16+
docker pull nipype/nipype
1517

16-
or if you want to build custom docker containers with specific versions of
17-
software see `Neurodocker <https://github.com/kaczmarj/neurodocker>`_
18+
You may also build custom docker containers with specific versions of software
19+
using Neurodocker_ (see the :doc:`neurodocker`).
1820

1921
Using conda
2022
~~~~~~~~~~~
@@ -108,7 +110,7 @@ Interface Dependencies
108110
Nipype provides wrappers around many neuroimaging tools and contains some
109111
algorithms. These tools will need to be installed for Nipype to run. You can
110112
create containers with different versions of these tools installed using
111-
`Neurodocker <https://github.com/kaczmarj/neurodocker>`_
113+
Neurodocker_ (see the :doc:`neurodocker`).
112114

113115
Installation for developers
114116
---------------------------

doc/users/neurodocker.rst

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
.. _neurodocker_tutorial:
2+
3+
====================
4+
Neurodocker tutorial
5+
====================
6+
7+
This page covers the steps to create containers with Neurodocker_.
8+
9+
Neurodocker_ is a command-line program that enables users to generate Docker_
10+
containers that include neuroimaging software. These containers can be
11+
converted to Singularity_ containers for use in high-performance computing
12+
centers.
13+
14+
Requirements:
15+
16+
* Docker_
17+
* Internet connection
18+
19+
20+
Usage
21+
-----
22+
23+
To view the Neurodocker help message
24+
::
25+
docker run --rm kaczmarj/neurodocker:v0.3.2 generate --help
26+
27+
1. Users must specify a base Docker image and the package manager. Any Docker
28+
image on DockerHub can be used as your base image. Common base images
29+
include ``debian:stretch``, ``ubuntu:16.04``, ``centos:7``, and the various
30+
``neurodebian`` images. If users would like to install software from the
31+
NeuroDebian repositories, it is recommended to use a ``neurodebian`` base
32+
image. The package manager is ``apt`` or ``yum``, depending on the base
33+
image.
34+
2. Next, users should configure the container to fit their needs. This includes
35+
installing neuroimaging software, installing packages from the chosen package
36+
manager, installing Python and Python packages, copying files from the local
37+
machine into the container, and other operations. The list of supported
38+
neuroimaging software packages is available in the ``neurodocker`` help
39+
message.
40+
3. The ``neurodocker`` command will generate a Dockerfile. This Dockerfile can
41+
be used to build a Docker image with the ``docker build`` command.
42+
43+
44+
Create a Dockerfile with FSL, Python 3.6, and Nipype
45+
----------------------------------------------------
46+
47+
This command prints a Dockerfile (the specification for a Docker image) to the
48+
terminal.
49+
::
50+
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
51+
--base debian:stretch --pkg-manager apt \
52+
--fsl version=5.0.10 \
53+
--miniconda env_name=neuro \
54+
conda_install="python=3.6 traits" \
55+
pip_install="nipype"
56+
57+
58+
Build the Docker image
59+
----------------------
60+
61+
The Dockerfile can be saved and used to build the Docker image
62+
::
63+
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
64+
--base debian:stretch --pkg-manager apt \
65+
--fsl version=5.0.10 \
66+
--miniconda env_name=neuro \
67+
conda_install="python=3.6 traits" \
68+
pip_install="nipype" > Dockerfile
69+
$ docker build --tag my_image .
70+
$ # or
71+
$ docker build --tag my_image - < Dockerfile
72+
73+
74+
Use NeuroDebian
75+
---------------
76+
77+
This example installs AFNI and ANTs from the NeuroDebian repositories. It also
78+
installs ``git`` and ``vim``.
79+
::
80+
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
81+
--base neurodebian:stretch --pkg-manager apt \
82+
--install afni ants git vim
83+
84+
Note: the ``--install`` option will install software using the package manager.
85+
Because the NeuroDebian repositories are enabled in the chosen base image, AFNI
86+
and ANTs may be installed using the package manager. ``git`` and ``vim`` are
87+
available in the default repositories.
88+
89+
90+
Other examples
91+
--------------
92+
93+
Create a container with ``dcm2niix``, Nipype, and jupyter notebook. Install
94+
Miniconda as a non-root user, and activate the Miniconda environment upon
95+
running the container.
96+
::
97+
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
98+
--base centos:7 --pkg-manager yum \
99+
--dcm2niix version=master \
100+
--user neuro \
101+
--miniconda env_name=neuro conda_install="jupyter traits nipype" \
102+
> Dockerfile
103+
$ docker build --tag my_nipype - < Dockerfile
104+
105+
106+
Copy local files into a container.
107+
::
108+
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
109+
--base ubuntu:16.04 --pkg-manager apt \
110+
--copy relative/path/to/source.txt /absolute/path/to/destination.txt
111+
112+
.. include:: ../links_names.txt

0 commit comments

Comments
 (0)