Skip to content

Commit 2f7a75e

Browse files
committed
doc+wip: re-implementation of rtd
1 parent ef65e78 commit 2f7a75e

File tree

8 files changed

+411
-0
lines changed

8 files changed

+411
-0
lines changed

README.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
heudiconv: A Heuristic-centric DICOM Converter
2+
3+
.. image:: https://img.shields.io/badge/docker-nipy/heudiconv:unstable-brightgreen.svg?logo=docker&style=flat
4+
:target: https://hub.docker.com/r/nipy/heudiconv/tags/
5+
:alt: Our Docker image
6+
7+
.. image:: https://travis-ci.org/nipy/heudiconv.svg?branch=master
8+
:target: https://travis-ci.org/nipy/heudiconv
9+
:alt: TravisCI
10+
11+
.. image:: https://codecov.io/gh/nipy/heudiconv/branch/master/graph/badge.svg
12+
:target: https://codecov.io/gh/nipy/heudiconv
13+
:alt: CodeCoverage
14+
15+
.. image:: https://readthedocs.org/projects/heudiconv/badge/?version=latest
16+
:target: http://heudiconv.readthedocs.io/en/latest/?badge=latest
17+
:alt: Readthedocs
18+
19+
About
20+
-----
21+
22+
``heudiconv`` is a flexible DICOM converter for organizing brain imaging data
23+
into structured directory layouts.
24+
25+
- it allows flexible directory layouts and naming schemes through
26+
customizable heuristics implementations
27+
- it only converts the necessary DICOMs, not everything in a directory
28+
- you can keep links to DICOM files in the participant layout
29+
- using dcm2niix under the hood, it's fast
30+
- it can track the provenance of the conversion from DICOM to NIfTI in W3C
31+
PROV format
32+
- it provides assistance in converting to `BIDS <http://bids.neuroimaging.io/>`
33+
- it integrates with `DataLad <https://www.datalad.org/>` to place converted and
34+
original data under git/git-annex version control, while automatically
35+
annotating files with sensitive information (e.g., non-defaced anatomicals, etc)

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'heudiconv'
23+
copyright = '2019, Heudiconv team'
24+
author = 'Heudiconv team'
25+
26+
# The short X.Y version
27+
version = ''
28+
# The full version, including alpha/beta/rc tags
29+
release = '0.5.4'
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# If your documentation needs a minimal Sphinx version, state it here.
35+
#
36+
# needs_sphinx = '1.0'
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
'sphinx.ext.autodoc',
43+
'recommonmark',
44+
]
45+
46+
# Add any paths that contain templates here, relative to this directory.
47+
templates_path = ['_templates']
48+
49+
# The suffix(es) of source filenames.
50+
# You can specify multiple suffix as a list of string:
51+
#
52+
# source_suffix = ['.rst', '.md']
53+
source_suffix = '.rst'
54+
55+
# The master toctree document.
56+
master_doc = 'index'
57+
58+
# The language for content autogenerated by Sphinx. Refer to documentation
59+
# for a list of supported languages.
60+
#
61+
# This is also used if you do content translation via gettext catalogs.
62+
# Usually you set "language" from the command line for these cases.
63+
language = None
64+
65+
# List of patterns, relative to source directory, that match files and
66+
# directories to ignore when looking for source files.
67+
# This pattern also affects html_static_path and html_extra_path.
68+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
69+
70+
# The name of the Pygments (syntax highlighting) style to use.
71+
pygments_style = None
72+
73+
74+
# -- Options for HTML output -------------------------------------------------
75+
76+
# The theme to use for HTML and HTML Help pages. See the documentation for
77+
# a list of builtin themes.
78+
#
79+
html_theme = 'alabaster'
80+
81+
# Theme options are theme-specific and customize the look and feel of a theme
82+
# further. For a list of options available for each theme, see the
83+
# documentation.
84+
#
85+
# html_theme_options = {}
86+
87+
# Add any paths that contain custom static files (such as style sheets) here,
88+
# relative to this directory. They are copied after the builtin static files,
89+
# so a file named "default.css" will overwrite the builtin "default.css".
90+
html_static_path = ['_static']
91+
92+
# Custom sidebar templates, must be a dictionary that maps document names
93+
# to template names.
94+
#
95+
# The default sidebars (for documents that don't match any pattern) are
96+
# defined by theme itself. Builtin themes are using these templates by
97+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
98+
# 'searchbox.html']``.
99+
#
100+
# html_sidebars = {}
101+
102+
103+
# -- Options for HTMLHelp output ---------------------------------------------
104+
105+
# Output file base name for HTML help builder.
106+
htmlhelp_basename = 'heudiconvdoc'
107+
108+
109+
# -- Options for LaTeX output ------------------------------------------------
110+
111+
latex_elements = {
112+
# The paper size ('letterpaper' or 'a4paper').
113+
#
114+
# 'papersize': 'letterpaper',
115+
116+
# The font size ('10pt', '11pt' or '12pt').
117+
#
118+
# 'pointsize': '10pt',
119+
120+
# Additional stuff for the LaTeX preamble.
121+
#
122+
# 'preamble': '',
123+
124+
# Latex figure (float) alignment
125+
#
126+
# 'figure_align': 'htbp',
127+
}
128+
129+
# Grouping the document tree into LaTeX files. List of tuples
130+
# (source start file, target name, title,
131+
# author, documentclass [howto, manual, or own class]).
132+
latex_documents = [
133+
(master_doc, 'heudiconv.tex', 'heudiconv Documentation',
134+
'Heudiconv team', 'manual'),
135+
]
136+
137+
138+
# -- Options for manual page output ------------------------------------------
139+
140+
# One entry per manual page. List of tuples
141+
# (source start file, name, description, authors, manual section).
142+
man_pages = [
143+
(master_doc, 'heudiconv', 'heudiconv Documentation',
144+
[author], 1)
145+
]
146+
147+
148+
# -- Options for Texinfo output ----------------------------------------------
149+
150+
# Grouping the document tree into Texinfo files. List of tuples
151+
# (source start file, target name, title, author,
152+
# dir menu entry, description, category)
153+
texinfo_documents = [
154+
(master_doc, 'heudiconv', 'heudiconv Documentation',
155+
author, 'heudiconv', 'One line description of project.',
156+
'Miscellaneous'),
157+
]
158+
159+
160+
# -- Options for Epub output -------------------------------------------------
161+
162+
# Bibliographic Dublin Core info.
163+
epub_title = project
164+
165+
# The unique identifier of the text. This can be a ISBN number
166+
# or the project homepage.
167+
#
168+
# epub_identifier = ''
169+
170+
# A unique identification for the text.
171+
#
172+
# epub_uid = ''
173+
174+
# A list of files that should not be packed into the epub file.
175+
epub_exclude_files = ['search.html']
176+
177+
178+
# -- Extension configuration -------------------------------------------------

docs/heuristics.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## The heuristic file
2+
3+
The heuristic file controls how information about the dicoms is used to convert
4+
to a file system layout (e.g., BIDS). This is a python file that must have the
5+
function `infotodict`, which takes a single argument `seqinfo`.
6+
7+
### `seqinfo` and the `s` variable
8+
9+
`seqinfo` is a list of namedtuple objects, each containing the following fields:
10+
11+
* total_files_till_now
12+
* example_dcm_file
13+
* series_id
14+
* dcm_dir_name
15+
* unspecified2
16+
* unspecified3
17+
* dim1
18+
* dim2
19+
* dim3
20+
* dim4
21+
* TR
22+
* TE
23+
* protocol_name
24+
* is_motion_corrected
25+
* is_derived
26+
* patient_id
27+
* study_description
28+
* referring_physician_name
29+
* series_description
30+
* image_type
31+
32+
```
33+
128 125000-1-1.dcm 1 - -
34+
- 160 160 128 1 0.00315 1.37 AAHScout False
35+
```
36+
37+
### The dictionary returned by `infotodict`
38+
39+
This dictionary contains as keys a 3-tuple `(template, a tuple of output types,
40+
annotation classes)`.
41+
42+
template - how the file should be relative to the base directory
43+
tuple of output types - what format of output should be created - nii.gz, dicom,
44+
etc.,.
45+
annotation classes - unused
46+
47+
```
48+
Example: ('func/sub-{subject}_task-face_run-{item:02d}_acq-PA_bold', ('nii.gz',
49+
'dicom'), None)
50+
```
51+
52+
A few fields are defined by default and can be used in the template:
53+
54+
- item: index within category
55+
- subject: participant id
56+
- seqitem: run number during scanning
57+
- subindex: sub index within group
58+
- session: session info for multi-session studies and when session has been
59+
defined as a parameter for heudiconv
60+
61+
Additional variables may be added and can be returned in the value of the
62+
dictionary returned from the function.
63+
64+
`info[some_3-tuple] = [12, 14, 16]` would assign dicom sequence groups 12, 14
65+
and 16 to be converted using the template specified in `some_3-tuple`.
66+
67+
if the template contained a non-sanctioned variable, it would have to be
68+
provided in the values for that key.
69+
70+
```
71+
some_3_tuple = ('func/sub-{subject}_task-face_run-{item:02d}_acq-{acq}_bold', ('nii.gz',
72+
'dicom'), None)
73+
```
74+
75+
In the above example `{acq}` is not a standard variable. In this case, values
76+
for this variable needs to be added.
77+
78+
```
79+
info[some_3-tuple] = [{'item': 12, 'acq': 'AP'},
80+
{'item': 14, 'acq': 'AP'},
81+
{'item': 16, 'acq': 'PA'}]
82+
```

docs/index.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. heudiconv documentation master file, created by
2+
sphinx-quickstart on Mon Mar 25 15:42:31 2019.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
.. include:: ../README.rst
7+
8+
Contents
9+
--------
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
14+
installation
15+
../CHANGELOG.md
16+
usage
17+
heuristics
18+
tutorials
19+
reference

docs/installation.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
Installation
3+
------------
4+
5+
``Heudiconv`` is packaged and available from many different sources.
6+
7+
8+
Local
9+
-----
10+
Released versions of HeuDiConv are available on `PyPI <https://pypi.org/project/heudiconv/>`
11+
and `conda <https://github.com/conda-forge/heudiconv-feedstock#installing-heudiconv>`.
12+
If installing through ``PyPI``, eg::
13+
14+
pip install heudiconv[all]
15+
16+
Manual installation of `dcm2niix <https://github.com/rordenlab/dcm2niix#install>`
17+
is required.
18+
19+
On Debian-based systems we recommend using `NeuroDebian <http://neuro.debian.net>`
20+
which provides the `heudiconv package <http://neuro.debian.net/pkgs/heudiconv.html>`.
21+
22+
23+
Docker
24+
------
25+
If `Docker <https://docs.docker.com/install/>` is available on your system, you
26+
can visit `our page on Docker Hub <https://hub.docker.com/r/nipy/heudiconv/tags>`
27+
to view available releases. To pull the latest release, run::
28+
29+
$ docker pull nipy/heudiconv:0.5.4
30+
31+
32+
Singularity
33+
-----------
34+
If `Singularity <https://www.sylabs.io/singularity/>` is available on your system,
35+
you can use it to pull and convert our Docker images! For example, to pull and
36+
build the latest release, you can run::
37+
38+
$ singularity pull docker://nipy/heudiconv:0.5.4

docs/tutorials.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Luckily(?), we live in an era of plentiful information. Below are some links to
2+
other users' tutorials covering their experience with ``heudiconv``.
3+
4+
- `YouTube tutorial <https://www.youtube.com/watch?v=O1kZAuR7E00>` by
5+
`James Kent <https://github.com/jdkent>`
6+
- `Walkthrough <http://reproducibility.stanford.edu/bids-tutorial-series-part-2a/>`
7+
by the `Standard Center for Reproducible Neuroscience <http://reproducibility.stanford.edu/>`
8+
- `Sample Conversion: Coastal Coding 2019 <http://www.repronim.org/coco2019-training/presentations/heudiconv/#1>`
9+
- `U of A Neuroimaging Core <https://neuroimaging-core-docs.readthedocs.io/en/latest/pages/heudiconv.html>`
10+
by `Dianne Patterson <https://github.com/dkp>`
11+
12+
* Note: some of these tutorials may not be 100% up to date with the latest releases
13+
of ``heudiconv``, so refer to this documentation first.

0 commit comments

Comments
 (0)