Skip to content

Commit 081ecc2

Browse files
committed
update docs
1 parent 160d1c4 commit 081ecc2

File tree

9 files changed

+153
-174
lines changed

9 files changed

+153
-174
lines changed

.zenodo.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,38 @@
33
"description": "<p>dMRIPrep is a robust and easy-to-use pipeline for preprocessing of dMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.</p>",
44
"creators": [
55
{
6-
"name": "Richie-Halford, Adam",
7-
"affiliation": "University of Washington",
8-
"orcid": "0000-0001-9276-9084"
6+
"name": "Richie-Halford, Adam",
7+
"affiliation": "University of Washington",
8+
"orcid": "0000-0001-9276-9084"
99
},
1010
{
11-
"name": "Rokem, Ariel",
12-
"affiliation": "The University of Washington eScience Institute",
13-
"orcid": "0000-0003-0679-1985"
11+
"name": "Rokem, Ariel",
12+
"affiliation": "The University of Washington eScience Institute",
13+
"orcid": "0000-0003-0679-1985"
1414
},
1515
{
16-
"name": "Yeatman, Jason",
17-
"affiliation": "Stanford University",
18-
"orcid": "0000-0002-2686-1293"
16+
"name": "Yeatman, Jason",
17+
"affiliation": "Stanford University",
18+
"orcid": "0000-0002-2686-1293"
1919
},
2020
{
21-
"name": "Joseph, Michael",
22-
"affiliation": "The Centre for Addiction and Mental Health",
23-
"orcid": "0000-0002-0068-230X"
21+
"name": "Joseph, Michael",
22+
"affiliation": "The Centre for Addiction and Mental Health",
23+
"orcid": "0000-0002-0068-230X"
2424
},
2525
{
26-
"name": "Mansour, Salim",
27-
"affiliation": "The Centre for Addiction and Mental Health"
26+
"name": "Mansour, Salim",
27+
"affiliation": "The Centre for Addiction and Mental Health"
2828
},
2929
{
30-
"name": "Keshavan, Anisha",
31-
"affiliation": "Child Mind Institute",
32-
"orcid": "0000-0003-3554-043X"
30+
"name": "Forde, Natalie",
31+
"affiliation": "The Centre for Addiction and Mental Health",
32+
"orcid": "0000-0002-2005-8774"
33+
},
34+
{
35+
"name": "Keshavan, Anisha",
36+
"affiliation": "Child Mind Institute",
37+
"orcid": "0000-0003-3554-043X"
3338
}
3439
]
3540
}

CHANGES.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
Upcoming release (TBD)
22
======================
33

4-
0.2.0 (August 20, 2019)
4+
0.2.0 (September 6, 2019)
55
=======================
66

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
7+
* ENH: Add workflow for concatenating dwi scans based on ``--concat_dwis`` list
8+
* ENH: Enable parallel processing of nodes
9+
* ENH: Run ``bids-validator`` before pipeline start
10+
* ENH: Switch crash logs from pickled objects to text files for easier reading by the user
1211
* 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
12+
* ENH: If b0s in the same phase encoding direction don't exist, allow topup to use them from the dwi image
13+
* ENH: Switch post-eddy mask creation node to use ``dwi2mask`` instead of ``median_otsu``
14+
* ENH: Take in a pre-specified acquisition parameters file for eddy instead of creating anew using ``--acqp_file``
15+
* ENH: Update command line interface with stricter validation of input arguments and options
16+
* ENH: Add workflow for using a synthetic b0 as a reverse PE image for topup (must be pre-generated)
17+
* ENH: Add workflows for susceptibility distortion correction using fieldmap, phasediff and phase1/phase2 scans
18+
* ENH: Add command line options for ignoring denoising and unringing and setting desired output resolution
19+
* ENH: Add ``dwidenoise``, ``mrdegibbs``, ``mrresize``, and ``dwibiascorrect`` from Mrtrix3 as preprocessing steps for the dwi images
20+
* ENH: Refactor ``run_dmriprep_pe`` workflow into a single subject workflow with separate sub-workflows for dwi pre-processing and topup
1421

1522
0.1.0 (September 6, 2018)
1623
=========================

dmriprep/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
# workflow configuration
109109
@click.option(
110110
'--nthreads',
111+
'--n_cpus',
111112
default=1,
112113
show_default=True,
113114
help='Maximum number of threads across all processes',

dmriprep/workflows/dwi/base.py

Lines changed: 44 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,8 @@ def init_dwi_preproc_wf(
100100
'dwi_meta',
101101
'bvec_file',
102102
'bval_file',
103-
'out_dir',
104-
]
105-
),
106-
name='inputnode',
107-
)
103+
'out_dir']),
104+
name='inputnode')
108105

109106
outputnode = pe.Node(
110107
niu.IdentityInterface(
@@ -122,11 +119,8 @@ def init_dwi_preproc_wf(
122119
'out_dtifit_FA',
123120
'out_dtifit_V1',
124121
'out_dtifit_sse',
125-
'out_noise',
126-
]
127-
),
128-
name='outputnode',
129-
)
122+
'out_noise']),
123+
name='outputnode')
130124

131125
def gen_index(in_file):
132126
"""
@@ -162,10 +156,8 @@ def gen_index(in_file):
162156

163157
gen_idx = pe.Node(
164158
niu.Function(
165-
input_names=['in_file'], output_names=['out_file'], function=gen_index
166-
),
167-
name='gen_index',
168-
)
159+
input_names=['in_file'], output_names=['out_file'], function=gen_index),
160+
name='gen_index')
169161

170162
def gen_acqparams(in_file, metadata):
171163
"""
@@ -217,17 +209,8 @@ def gen_acqparams(in_file, metadata):
217209
niu.Function(
218210
input_names=['in_file', 'metadata'],
219211
output_names=['out_file'],
220-
function=gen_acqparams,
221-
),
222-
name='acqp',
223-
)
224-
225-
dwi_wf.connect(
226-
[
227-
(inputnode, gen_idx, [('dwi_file', 'in_file')]),
228-
(inputnode, acqp, [('dwi_file', 'in_file'), ('dwi_meta', 'metadata')]),
229-
]
230-
)
212+
function=gen_acqparams),
213+
name='acqp')
231214

232215
dwi_artifacts_wf = init_dwi_artifacts_wf(ignore, output_resolution)
233216

@@ -268,10 +251,8 @@ def b0_average(in_dwi, in_bval, b0_thresh, out_file=None):
268251
niu.Function(
269252
input_names=['in_dwi', 'in_bval', 'b0_thresh'],
270253
output_names=['out_file'],
271-
function=b0_average,
272-
),
273-
name='b0_avg_pre',
274-
)
254+
function=b0_average),
255+
name='b0_avg_pre')
275256

276257
avg_b0_0.inputs.b0_thresh = b0_thresh
277258

@@ -281,22 +262,13 @@ def b0_average(in_dwi, in_bval, b0_thresh, out_file=None):
281262

282263
ecc = pe.Node(
283264
fsl.Eddy(num_threads=omp_nthreads, repol=True, cnr_maps=True, residuals=True),
284-
name='fsl_eddy',
285-
)
265+
name='fsl_eddy')
286266
try:
287267
if cuda.gpus:
288268
ecc.inputs.use_cuda = True
289269
except:
290270
ecc.inputs.use_cuda = False
291271

292-
dwi_wf.connect(
293-
[
294-
(inputnode, dwi_artifacts_wf, [('dwi_file', 'inputnode.dwi_file')]),
295-
(dwi_artifacts_wf, avg_b0_0, [('outputnode.out_file', 'in_dwi')]),
296-
(dwi_artifacts_wf, ecc, [('outputnode.out_file', 'in_file')])
297-
]
298-
)
299-
300272
denoise_eddy = pe.Node(mrtrix3.DWIDenoise(), name='denoise_eddy')
301273

302274
eddy_quad = pe.Node(fsl.EddyQuad(verbose=True), name='eddy_quad')
@@ -325,61 +297,42 @@ def get_b0_mask_fn(b0_file):
325297

326298
b0mask_node = pe.Node(
327299
niu.Function(
328-
input_names=['b0_file'], output_names=['mask_file'], function=get_b0_mask_fn
329-
),
330-
name='getB0Mask',
331-
)
332-
333-
dwi_wf.connect(
334-
[
335-
(inputnode, avg_b0_0, [('bval_file', 'in_bval')]),
336-
(avg_b0_0, bet_dwi0, [('out_file', 'in_file')]),
337-
(inputnode, ecc, [('bval_file', 'in_bval'),
338-
('bvec_file', 'in_bvec')]),
339-
(bet_dwi0, ecc, [('mask_file', 'in_mask')]),
340-
(gen_idx, ecc, [('out_file', 'in_index')]),
341-
(acqp, ecc, [('out_file', 'in_acqp')]),
342-
(ecc, denoise_eddy, [('out_corrected', 'in_file')]),
343-
(
344-
ecc,
345-
bias_correct,
346-
[('out_corrected', 'in_file'), ('out_rotated_bvecs', 'in_bvec')],
347-
),
348-
(inputnode, bias_correct, [('bval_file', 'in_bval')]),
349-
(bias_correct, fslroi, [('out_file', 'in_file')]),
350-
(fslroi, b0mask_node, [('roi_file', 'b0_file')]),
351-
(
352-
ecc,
353-
eddy_quad,
354-
[
355-
(('out_corrected', get_path), 'base_name'),
356-
(('out_corrected', get_qc_path), 'output_dir'),
357-
('out_rotated_bvecs', 'bvec_file'),
358-
],
359-
),
360-
(inputnode, eddy_quad, [('bval_file', 'bval_file')]),
361-
(b0mask_node, eddy_quad, [('mask_file', 'mask_file')]),
362-
(gen_idx, eddy_quad, [('out_file', 'idx_file')]),
363-
(acqp, eddy_quad, [('out_file', 'param_file')]),
364-
]
365-
)
300+
input_names=['b0_file'], output_names=['mask_file'], function=get_b0_mask_fn),
301+
name='getB0Mask')
366302

367303
tensor_wf = init_dwi_tensor_wf()
368304

369-
dwi_wf.connect(
370-
[
371-
(inputnode, tensor_wf, [('bval_file', 'inputnode.bval_file')]),
372-
(b0mask_node, tensor_wf, [('mask_file', 'inputnode.mask_file')]),
373-
(
374-
ecc,
375-
tensor_wf,
376-
[
377-
('out_corrected', 'inputnode.dwi_file'),
378-
('out_rotated_bvecs', 'inputnode.bvec_file'),
379-
],
380-
),
381-
]
382-
)
305+
dwi_wf.connect([
306+
(inputnode, gen_idx, [('dwi_file', 'in_file')]),
307+
(inputnode, acqp, [('dwi_file', 'in_file'), ('dwi_meta', 'metadata')]),
308+
(inputnode, dwi_artifacts_wf, [('dwi_file', 'inputnode.dwi_file')]),
309+
(dwi_artifacts_wf, avg_b0_0, [('outputnode.out_file', 'in_dwi')]),
310+
(dwi_artifacts_wf, ecc, [('outputnode.out_file', 'in_file')]),
311+
(inputnode, avg_b0_0, [('bval_file', 'in_bval')]),
312+
(avg_b0_0, bet_dwi0, [('out_file', 'in_file')]),
313+
(inputnode, ecc, [('bval_file', 'in_bval'),
314+
('bvec_file', 'in_bvec')]),
315+
(bet_dwi0, ecc, [('mask_file', 'in_mask')]),
316+
(gen_idx, ecc, [('out_file', 'in_index')]),
317+
(acqp, ecc, [('out_file', 'in_acqp')]),
318+
(ecc, denoise_eddy, [('out_corrected', 'in_file')]),
319+
(ecc, bias_correct, [('out_corrected', 'in_file'),
320+
('out_rotated_bvecs', 'in_bvec')]),
321+
(inputnode, bias_correct, [('bval_file', 'in_bval')]),
322+
(bias_correct, fslroi, [('out_file', 'in_file')]),
323+
(fslroi, b0mask_node, [('roi_file', 'b0_file')]),
324+
(ecc, eddy_quad, [(('out_corrected', get_path), 'base_name'),
325+
(('out_corrected', get_qc_path), 'output_dir'),
326+
('out_rotated_bvecs', 'bvec_file')]),
327+
(inputnode, eddy_quad, [('bval_file', 'bval_file')]),
328+
(b0mask_node, eddy_quad, [('mask_file', 'mask_file')]),
329+
(gen_idx, eddy_quad, [('out_file', 'idx_file')]),
330+
(acqp, eddy_quad, [('out_file', 'param_file')]),
331+
(inputnode, tensor_wf, [('bval_file', 'inputnode.bval_file')]),
332+
(b0mask_node, tensor_wf, [('mask_file', 'inputnode.mask_file')]),
333+
(ecc, tensor_wf, [('out_corrected', 'inputnode.dwi_file'),
334+
('out_rotated_bvecs', 'inputnode.bvec_file')])
335+
])
383336

384337
# # If synb0 is meant to be used
385338
# if synb0_dir:

dmriprep/workflows/dwi/eddy.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def init_dwi_eddy_wf(omp_nthreads, sdc_method):
7979

8080
ecc = pe.Node(
8181
fsl.Eddy(num_threads=omp_nthreads, repol=True, cnr_maps=True, residuals=True),
82-
name='fsl_eddy',
83-
)
82+
name='fsl_eddy')
8483

8584
try:
8685
if cuda.gpus:
@@ -97,7 +96,7 @@ def init_dwi_eddy_wf(omp_nthreads, sdc_method):
9796
('mask_file', 'in_mask')]),
9897
(ecc, outputnode, [('out_corrected', 'out_file'),
9998
('out_rotated_bvecs', 'out_bvec')])
100-
])
99+
])
101100

102101
if sdc_method == 'fieldmap':
103102
wf.connect([

dmriprep/workflows/dwi/tensor.py

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51,55 +51,38 @@ def init_dwi_tensor_wf():
5151
5252
"""
5353

54-
wf = pe.Workflow(name="dwi_tensor_wf")
54+
wf = pe.Workflow(name='dwi_tensor_wf')
5555

5656
inputnode = pe.Node(
5757
niu.IdentityInterface(
58-
fields=["dwi_file", "bvec_file", "bval_file", "mask_file"]
59-
),
60-
name="inputnode",
61-
)
58+
fields=['dwi_file', 'bvec_file', 'bval_file', 'mask_file']),
59+
name='inputnode')
6260

6361
outputnode = pe.Node(
6462
niu.IdentityInterface(
65-
fields=["FA_file", "MD_file", "AD_file", "RD_file", "V1_file", "sse_file"]
66-
),
67-
name="outputnode",
68-
)
69-
70-
dtifit = pe.Node(fsl.DTIFit(save_tensor=True, sse=True), name="dtifit")
71-
72-
add_l2_l3 = pe.Node(fsl.BinaryMaths(operation="add"), name="add_l2_l3")
73-
74-
calc_rd = pe.Node(fsl.BinaryMaths(operand_value=2, operation="div"), name="calc_rd")
75-
76-
wf.connect(
77-
[
78-
(
79-
inputnode,
80-
dtifit,
81-
[
82-
("dwi_file", "dwi"),
83-
("bvec_file", "bvecs"),
84-
("bval_file", "bvals"),
85-
("mask_file", "mask"),
86-
],
87-
),
88-
(dtifit, add_l2_l3, [("L2", "in_file"), ("L3", "operand_file")]),
89-
(add_l2_l3, calc_rd, [("out_file", "in_file")]),
90-
(calc_rd, outputnode, [("out_file", "RD_file")]),
91-
(
92-
dtifit,
93-
outputnode,
94-
[
95-
("FA", "FA_file"),
96-
("MD", "MD_file"),
97-
("L1", "AD_file"),
98-
("V1", "V1_file"),
99-
("sse", "sse_file"),
100-
],
101-
),
102-
]
103-
)
63+
fields=['FA_file', 'MD_file', 'AD_file', 'RD_file', 'V1_file', 'sse_file']),
64+
name='outputnode')
65+
66+
dtifit = pe.Node(fsl.DTIFit(save_tensor=True, sse=True), name='dtifit')
67+
68+
add_l2_l3 = pe.Node(fsl.BinaryMaths(operation='add'), name='add_l2_l3')
69+
70+
calc_rd = pe.Node(fsl.BinaryMaths(operand_value=2, operation='div'), name='calc_rd')
71+
72+
wf.connect([
73+
(inputnode, dtifit, [('dwi_file', 'dwi'),
74+
('bvec_file', 'bvecs'),
75+
('bval_file', 'bvals'),
76+
('mask_file', 'mask')]),
77+
(dtifit, add_l2_l3, [('L2', 'in_file'),
78+
('L3', 'operand_file')]),
79+
(add_l2_l3, calc_rd, [('out_file', 'in_file')]),
80+
(calc_rd, outputnode, [('out_file', 'RD_file')]),
81+
(dtifit, outputnode, [('FA', 'FA_file'),
82+
('MD', 'MD_file'),
83+
('L1', 'AD_file'),
84+
('V1', 'V1_file'),
85+
('sse', 'sse_file')])
86+
])
10487

10588
return wf

0 commit comments

Comments
 (0)