Skip to content

Commit 7272a5f

Browse files
committed
update docs
1 parent d585f8a commit 7272a5f

File tree

14 files changed

+168
-26
lines changed

14 files changed

+168
-26
lines changed

AUTHORS.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Credits
55
Development Leads
66
-----------------
77

8-
- Anisha Keshavan <[email protected]> [Corresponding developer]
9-
- Adam Richie-Halford <[email protected]>
8+
- _Anisha Keshavan: [email protected] [Corresponding developer]
9+
- _Adam Richie-Halford: [email protected]>
1010

1111
Contributors
1212
------------
1313

14-
- Ariel Rokem <[email protected]>
15-
- Michael Joseph <[email protected]>
16-
- Salim Mansour <[email protected]>
14+
- _Ariel Rokem: [email protected]
15+
- _Michael Joseph: [email protected]
16+
- _Salim Mansour: [email protected]

CHANGES.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
0.1.0 (2018-09-06)
2-
==================
1+
Upcoming release (TBD)
2+
======================
33

4-
* First release on GitHub.
4+
0.2.0 (August 20, 2019)
5+
=======================
56

7+
* ENH: Add ``collect_participants`` and ``validate_input_dir`` functions (taken from niworkflows)
8+
* ENH: Add ``dwidenoise``, ``mrdegibbs``, ``mrresize``, and ``dwibiascorrect`` from Mrtrix3 as preprocessing steps for the dwi images
9+
* ENH: Add workflow for using a synthetic b0 as a reverse PE image for topup
10+
* ENH: Add workflows for dealing with fieldmap, phasediff and phase1/phase2 scans (taken from sdcflows)
11+
* ENH: Switch crash logs from pickle to text files for easier reading by the user
12+
* MAINT: Migrate to a setup.cfg style of installation
13+
* ENH: Refactor ``run_dmriprep_pe`` workflow into a single subject workflow with separate sub-workflows for dwi and fieldmap pre-processing
14+
15+
0.1.0 (September 6, 2018)
16+
=========================
17+
18+
* First release on GitHub.

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ coverage: ## check code coverage quickly with the default Python
6666
$(BROWSER) htmlcov/index.html
6767

6868
docs: ## generate Sphinx HTML documentation, including API docs
69-
rm -f docs/dmriprep.rst
69+
rm -f docs/dmriprep*.rst
7070
rm -f docs/modules.rst
7171
sphinx-apidoc -o docs/ dmriprep
7272
$(MAKE) -C docs clean
@@ -86,3 +86,9 @@ dist: clean ## builds source and wheel package
8686

8787
install: clean ## install the package to the active Python's site-packages
8888
python setup.py install
89+
90+
docker-dev: ## build the development environment
91+
docker build -t dmriprep:dev -f docker/Dockerfile docker/.
92+
93+
docker: docker-dev
94+
docker build -t dmriprep:prod -f Dockerfile-dmriprep .

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ Credits
5252
-------
5353

5454
This package was created with `Cookiecutter <https://github.com/audreyr/cookiecutter>`_ and the `audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage>`_ project template.
55+
Several pieces of code have been taken from `fmriprep <https://github.com/poldracklab/fmriprep>`_, `niworkflows <https://github.com/poldracklab/niworkflows>`_ and `sdcflows <https://github.com/poldracklab/sdcflows>`_.

dmriprep/workflows/base.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717

1818

1919
def init_dmriprep_wf(parameters):
20+
"""
21+
This workflow organizes the execusion of dMRIPrep, with a sub-workflow for
22+
each subject.
23+
24+
.. workflow::
25+
:graph2use: orig
26+
:simple_form: yes
27+
28+
wf = init_dmriprep_wf()
29+
30+
Parameters
31+
32+
"""
2033
dmriprep_wf = pe.Workflow(name="dmriprep_wf")
2134
dmriprep_wf.base_dir = parameters.work_dir
2235

@@ -31,6 +44,9 @@ def init_dmriprep_wf(parameters):
3144
single_subject_wf.config["execution"]["crashdump_dir"] = os.path.join(
3245
parameters.output_dir, "dmriprep", "sub-" + subject_id, "log"
3346
)
47+
single_subject_wf.config["execution"]["remove_unnecessary_outputs"] = False
48+
single_subject_wf.config["execution"]["keep_inputs"] = True
49+
single_subject_wf.config["execution"]["crashfile_format"] = "txt"
3450

3551
for node in single_subject_wf._get_all_nodes():
3652
node.config = deepcopy(single_subject_wf.config)
@@ -41,6 +57,25 @@ def init_dmriprep_wf(parameters):
4157

4258

4359
def init_single_subject_wf(subject_id, name, parameters):
60+
"""
61+
This workflow organizes the preprocessing pipeline for a single subject.
62+
It collects and reports information about the subject, and prepares
63+
sub-workflows to perform diffusion preprocessing.
64+
65+
Diffusion preprocessing is performed using a separate workflow for each
66+
individual dwi series.
67+
68+
.. workflow::
69+
:graph2use: orig
70+
:simple_form: yes
71+
72+
wf = init_single_subject_wf()
73+
74+
Parameters
75+
76+
Inputs
77+
78+
"""
4479

4580
dwi_files = parameters.layout.get(
4681
subject=subject_id,

dmriprep/workflows/dwi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def _get_wf_name(dwi_fname):
441441

442442
fname = split_filename(dwi_fname)[1]
443443
fname_nosub = "_".join(fname.split("_")[1:])
444-
name = "func_preproc_" + fname_nosub.replace(".", "_").replace(" ", "").replace(
444+
name = "dwi_preproc_" + fname_nosub.replace(".", "_").replace(" ", "").replace(
445445
"-", "_"
446446
).replace("_dwi", "_wf")
447447

dmriprep/workflows/dwi/prep_dwi.py

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,54 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
Denoising, unringing and resampling of dwi images
5-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
Artefact removal and resampling dwi images
5+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
.. autofunction:: init_prep_dwi_wf
68
79
"""
810

911
from nipype.pipeline import engine as pe
1012
from nipype.interfaces import mrtrix3, utility as niu
1113

1214

13-
def init_prep_dwi_wf(ignore, output_resolution):
15+
def init_prep_dwi_wf(ignore, output_resolution, name="prep_dwi_wf"):
16+
"""
17+
This workflow performs denoises and unrings the inputs dwi image and optionally
18+
resamples the image to the desired output resolution.
19+
20+
Denoising is done using Mrtrix3 using the MP-PCA algorithm [Veraart2016_].
21+
Unringing is done using Mrtrix3 [Kellner2016]_.
22+
23+
.. workflow::
24+
:graph2use: orig
25+
:simple_form: yes
26+
27+
from dmriprep.workflows.dwi import init_prep_dwi_wf
28+
wf = init_prep_dwi_wf(ignore=[], output_resolution=(1, 1, 1))
29+
30+
**Parameters**
31+
32+
ignore : list
33+
List of artefact removal steps to skip (default: None)
34+
output_resolution : tuple
35+
Tuple defining the new voxel size for the output image in the x, y, and z dimensions
36+
name : str
37+
Name of workflow (default: ``prep_dwi_wf``)
38+
39+
**Inputs**
40+
41+
dwi_file
42+
dwi NIfTI file
43+
44+
**Outputs**
45+
46+
out_file
47+
dwi NIfTI file after artefact removal and resizing
48+
49+
"""
1450

15-
prep_dwi_wf = pe.Workflow(name="prep_dwi_wf")
51+
prep_dwi_wf = pe.Workflow(name=name)
1652

1753
inputnode = pe.Node(niu.IdentityInterface(fields=["dwi_file"]), name="inputnode")
1854

docs/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
What's new
33
----------
44

5-
.. includes:: ../CHANGES.rst
5+
.. include:: ../CHANGES.rst

docs/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@
3636
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3737
extensions = [
3838
"sphinx.ext.autodoc",
39+
"sphinx.ext.doctest",
40+
"sphinx.ext.intersphinx",
3941
"sphinx.ext.viewcode",
40-
"sphinx.ext.napoleon",
41-
"sphinx_click.ext",
42+
"sphinx.ext.napoleon", # support for reading numpy and Google style docstrings
43+
"sphinx_click.ext", # click extension
44+
"nipype.sphinxext.plot_workflow" # nipype extension to plot workflows
4245
]
4346

4447
# Add any paths that contain templates here, relative to this directory.

docs/dmriprep.interfaces.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ dmriprep.interfaces.fmap module
1212
:undoc-members:
1313
:show-inheritance:
1414

15+
dmriprep.interfaces.fsl module
16+
------------------------------
17+
18+
.. automodule:: dmriprep.interfaces.fsl
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
1523
dmriprep.interfaces.mrtrix3 module
1624
----------------------------------
1725

@@ -20,6 +28,14 @@ dmriprep.interfaces.mrtrix3 module
2028
:undoc-members:
2129
:show-inheritance:
2230

31+
dmriprep.interfaces.reportlets module
32+
-------------------------------------
33+
34+
.. automodule:: dmriprep.interfaces.reportlets
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
2339

2440
Module contents
2541
---------------

0 commit comments

Comments
 (0)