Skip to content

Commit 1dff504

Browse files
committed
updated docs
1 parent 46c4993 commit 1dff504

File tree

7 files changed

+167
-18
lines changed

7 files changed

+167
-18
lines changed

CONTRIBUTING.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,74 @@
44
Contributing
55
============
66

7+
.. code-block:: console
8+
9+
dmriprep
10+
├── CHANGES.rst
11+
├── CONTRIBUTING.rst
12+
├── dmriprep
13+
│   ├── __about__.py
14+
│   ├── cli.py
15+
│   ├── data
16+
│   │   ├── boilerplate.bib
17+
| | ├── eddy_parameters
18+
│   │   └── ENIGMA_targets
19+
│   ├── due.py
20+
│   ├── __init__.py
21+
│   ├── interfaces
22+
│   │   ├── fmap.py
23+
│   │   ├── __init__.py
24+
│   │   └── reportlets.py
25+
│   ├── qc.py
26+
│   ├── utils
27+
│   │   ├── bids.py
28+
│   │   ├── hemisphere.py
29+
│   │   └── __init__.py
30+
│   ├── _version.py
31+
│   ├── viz
32+
│   │   ├── __init__.py
33+
│   │   └── utils.py
34+
│   └── workflows
35+
│   ├── anatomical.py
36+
│   ├── base.py
37+
│   ├── dwi
38+
│   │   ├── __init__.py
39+
│   │   ├── artifacts.py
40+
│   │   ├── base.py
41+
│   │   ├── eddy.py
42+
│   │   ├── outputs.py
43+
│   │   ├── qc.py
44+
│   │   ├── tensor.py
45+
│   │   └── util.py
46+
│   ├── fieldmap
47+
│   │   ├── __init__.py
48+
│   │   ├── ants.py
49+
│   │   ├── base.py
50+
│   │   ├── brainsuite.py
51+
│   │   ├── fmap.py
52+
│   │   ├── pepolar.py
53+
│   │   ├── phasediff.py
54+
│   │   └── synb0.py
55+
│   └── __init__.py
56+
├── Dockerfile
57+
├── docs
58+
├── LICENSE
59+
├── long_description.rst
60+
├── Makefile
61+
├── MANIFEST.in
62+
├── pyproject.toml
63+
├── README.rst
64+
├── REFERENCES.rst
65+
├── setup.cfg
66+
├── setup.py
67+
├── tests
68+
│   ├── __init__.py
69+
│   ├── test_dmriprep.py
70+
│   └── test_utils.py
71+
├── tox.ini
72+
├── update_changes.sh
73+
└── versioneer.py
74+
775
We love contributions! dmriprep is open source, built on open source,
876
and we'd love to have you hang out in our community.
977

dmriprep/workflows/anatomical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from niworkflows.anat.ants import init_brain_extraction_wf
1515

1616

17-
def init_anat_preproc_wf()
17+
def init_anat_preproc_wf():
1818
"""
1919
"""
2020

dmriprep/workflows/dwi/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def init_dwi_concat_wf(ref_file):
2222
:simple_form: yes
2323
2424
from dmriprep.workflows.dwi import init_dwi_concat_wf
25-
wf = init_dwi_artifacts_wf(ref_file='/madeup/path/sub-01_dwi.nii.gz')
25+
wf = init_dwi_concat_wf(ref_file='/madeup/path/sub-01_dwi.nii.gz')
2626
2727
**Parameters**
2828

dmriprep/workflows/fieldmap/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
from .pepolar import init_pepolar_wf
55
from .fmap import init_fmap_wf
66
from .phasediff import init_phase_wf, init_phdiff_wf
7+
from .brainsuite import init_brainsuite_wf

dmriprep/workflows/fieldmap/brainsuite.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from nipype.pipeline import engine as pe
1212
from nipype.interfaces import brainsuite, utility as niu
1313

14-
def init_fmap_wf():
14+
15+
def init_brainsuite_wf():
1516

1617
wf = pe.Workflow(name='brainsuite_wf')
1718

@@ -21,7 +22,9 @@ def init_fmap_wf():
2122
'T1w',
2223
'T1w_mask',
2324
'dwi_file',
24-
'dwi_mask']),
25+
'dwi_mask',
26+
'bvec_file',
27+
'bval_file']),
2528
name='inputnode')
2629

2730
outputnode = pe.Node(
@@ -30,16 +33,14 @@ def init_fmap_wf():
3033

3134
bias_corr = pe.Node(brainsuite.Bfc(minBias=0.5, maxBias=1.5), name='bias_corr')
3235

36+
# nipype spec doesn't have an output definition yet!
3337
bdp = pe.Node(brainsuite.BDP(), name='bdp')
3438

35-
wf.connect([])
36-
37-
# bfc -i $indir2/brain.nii.gz -o T1.bfc.nii.gz
38-
39-
# /KIMEL/tigrlab/quarantine/brainsuite/18a/build/bdp/bdp.sh \
40-
# T1.bfc.nii.gz \
41-
# --t1-mask $indir2/brainmaskautobet_mask.nii.gz \
42-
# --nii $indir1/data.nii.gz \
43-
# --dwi-mask $indir1/nodif_brain_mask.nii.gz \
44-
# -b $indir1/bval.txt \
45-
# -g $indir1/eddy_bvecs.txt
39+
wf.connect([
40+
(inputnode, bias_corr, [('T1w', 'inputMRIFile')]),
41+
(bias_corr, bdp, [('outputMRIVolume', 'bfcFile'),
42+
('T1w_mask', 't1Mask'),
43+
('dwi_file', 'inputDiffusionData'),
44+
('dwi_mask', 'dwiMask'),
45+
('bvec_file', 'BVecBValPair')])
46+
])

docs/dmriprep.workflows.fieldmap.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ dmriprep.workflows.fieldmap package
44
Submodules
55
----------
66

7+
dmriprep.workflows.fieldmap.ants module
8+
---------------------------------------
9+
10+
.. automodule:: dmriprep.workflows.fieldmap.ants
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
715
dmriprep.workflows.fieldmap.base module
816
---------------------------------------
917

docs/workflows.rst

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ DWI preprocessing
4848
:graph2use: orig
4949
:simple_form: yes
5050

51-
from collections import namedtuple
52-
from dmriprep.workflows.dwi import init_dwi_preproc_wf
53-
BIDSLayout = namedtuple('BIDSLayout', ['root'])
5451
from collections import namedtuple
5552
from dmriprep.workflows.dwi import init_dwi_preproc_wf
5653
BIDSLayout = namedtuple('BIDSLayout', ['root'])
@@ -69,3 +66,77 @@ DWI preprocessing
6966
)
7067

7168
Preprocessing of DWI files is split into multiple sub-workflows described below.
69+
70+
Concatenating Scans
71+
^^^^^^^^^^^^^^^^^^^
72+
:mod:`dmriprep.workflows.dwi.util.init_dwi_concat_wf`
73+
74+
By default, each scan in the ``dwi`` folder will get preprocessed separately. However,
75+
there are some cases where multiple scans should be concatenated before head motion,
76+
eddy current distortion and susceptibility distortion correction (eg. single-shell
77+
or multi-shell scan acquired in separate runs).
78+
79+
.. code-block:: console
80+
81+
bids
82+
└── sub-01
83+
└── dwi
84+
  ├── sub-01_acq-multishelldir30b1000_dwi.nii.gz
85+
  ├── sub-01_acq-multishelldir30b3000_dwi.nii.gz
86+
 ├── sub-01_acq-multishelldir30b4500_dwi.nii.gz
87+
  └── sub-01_acq-singleshelldir60b1000_dwi.nii.gz
88+
89+
In the above example, the multi-shell scans should be concatenated and the single-shell
90+
scan should be left alone. This is done
91+
92+
``--concat_dwis multishelldir30b1000 multishelldir30b3000 multishelldir30b4500``
93+
94+
95+
.. workflow::
96+
:graph2use: orig
97+
:simple_form: yes
98+
99+
from dmriprep.workflows.dwi import init_dwi_concat_wf
100+
wf = init_dwi_concat_wf(ref_file='/madeup/path/sub-01_dwi.nii.gz')
101+
102+
Artifact Removal
103+
^^^^^^^^^^^^^^^^
104+
:mod:`dmriprep.workflows.dwi.artifacts.init_dwi_artifacts_wf`
105+
106+
.. workflow::
107+
:graph2use: orig
108+
:simple_form: yes
109+
110+
from dmriprep.workflows.dwi import init_dwi_artifacts_wf
111+
wf = init_dwi_artifacts_wf(ignore=[], output_resolution=(1, 1, 1))
112+
113+
114+
Susceptibility Distortion Correction (SDC)
115+
------------------------------------------
116+
117+
Introduction
118+
^^^^^^^^^^^^
119+
120+
Correction Methods
121+
^^^^^^^^^^^^^^^^^^
122+
123+
1. topup
124+
2. fieldmap
125+
3. phasediff
126+
4. phase1/phase2
127+
5. nonlinear registration
128+
- ants
129+
- brainsuite
130+
6. synthetic b0
131+
132+
The synb0 method is based off of this `paper <https://www.sciencedirect.com/science/article/abs/pii/S0730725X18306179/>`_. It offers an alternative method of SDC by using deep learning on an anatomical image (T1).
133+
You can use it in this pipeline by generating the synb0s for the subject(s) and passing the bids-like directory containing them to the --synb0_dir parameter. To find out how to generate the synb0s, you can visit our `forked repo <https://github.com/TIGRLab/Synb0-DISCO>`_.
134+
Once you have a directory of synb0s (recommended to place as derivatives of bids folder, ex. bids/derivatives/synb0/sub-XX), then you are ready to run the pipeline using them! Just run dmripreproc as you usually would, with bids_dir and output_dir, but now add "--synb0_dir <your_synb0_directory>" to your command.
135+
The synb0 acqp for topup and eddy will be automatically generated in the pipeline in the following format:
136+
137+
..code-block:: console
138+
139+
0 -1 0 <total_readout_time>
140+
0 1 0 0
141+
142+
If you want to overwrite the total_readout_time with one of your own, simply add ``--total_readout <new_trt_time>`` to your command.

0 commit comments

Comments
 (0)