|
1 |
| -# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- |
2 |
| -# vi: set ft=python sts=4 ts=4 sw=4 et: |
3 |
| - |
4 | 1 | """
|
5 | 2 | Utility workflows
|
6 | 3 | ^^^^^^^^^^^^^^^^^
|
|
19 | 16 | from niworkflows.interfaces.masks import SimpleShowMaskRPT
|
20 | 17 | from niworkflows.interfaces.utils import CopyXForm
|
21 | 18 |
|
22 |
| -from ...interfaces.images import MeanB0 |
| 19 | +from ...interfaces.images import ExtractB0 |
| 20 | +from ...interfaces.registration import EstimateReferenceImage |
23 | 21 |
|
24 | 22 | DEFAULT_MEMORY_MIN_GB = 0.01
|
25 | 23 |
|
@@ -57,7 +55,7 @@ def init_dwi_reference_wf(omp_nthreads, dwi_file=None,
|
57 | 55 | dwi_file
|
58 | 56 | Validated dwi NIfTI file
|
59 | 57 | raw_ref_image
|
60 |
| - Reference image to which dwi series is motion corrected |
| 58 | + Reference image |
61 | 59 | ref_image
|
62 | 60 | Contrast-enhanced reference image
|
63 | 61 | ref_image_brain
|
@@ -92,19 +90,21 @@ def init_dwi_reference_wf(omp_nthreads, dwi_file=None,
|
92 | 90 |
|
93 | 91 | validate = pe.Node(ValidateImage(), name='validate', mem_gb=DEFAULT_MEMORY_MIN_GB)
|
94 | 92 |
|
95 |
| - gen_ref = pe.Node(MeanB0(), name="gen_ref") |
| 93 | + extract_b0 = pe.Node(ExtractB0(), name="extract_b0") |
96 | 94 |
|
97 | 95 | pre_mask = pe.Node(afni.Automask(outputtype="NIFTI_GZ"), name="pre_mask")
|
98 | 96 |
|
| 97 | + gen_ref = pe.Node(EstimateReferenceImage(), name='gen_ref') |
| 98 | + |
99 | 99 | enhance_and_skullstrip_dwi_wf = init_enhance_and_skullstrip_dwi_wf(
|
100 | 100 | omp_nthreads=omp_nthreads)
|
101 | 101 |
|
102 | 102 | workflow.connect([
|
103 | 103 | (inputnode, validate, [('dwi_file', 'in_file')]),
|
104 |
| - (validate, gen_ref, [('out_file', 'in_file')]), |
105 |
| - (inputnode, gen_ref, [('bvec_file', 'in_bvec'), |
106 |
| - ('bval_file', 'in_bval')]), |
107 |
| - (gen_ref, pre_mask, [('out_file', 'in_file')]), |
| 104 | + (validate, extract_b0, [('out_file', 'in_file')]), |
| 105 | + (extract_b0, pre_mask, [('out_file', 'in_file')]), |
| 106 | + (extract_b0, gen_ref, [('out_file', 'in_file')]), |
| 107 | + (pre_mask, gen_ref, [('out_file', 'pre_mask')]), |
108 | 108 | (gen_ref, enhance_and_skullstrip_dwi_wf, [('out_file', 'inputnode.in_file')]),
|
109 | 109 | (pre_mask, enhance_and_skullstrip_dwi_wf, [('out_file', 'inputnode.pre_mask')]),
|
110 | 110 | (validate, outputnode, [('out_file', 'dwi_file'),
|
@@ -132,7 +132,7 @@ def init_enhance_and_skullstrip_dwi_wf(
|
132 | 132 | name='enhance_and_skullstrip_dwi_wf',
|
133 | 133 | omp_nthreads=1):
|
134 | 134 | """
|
135 |
| - This workflow takes in a dwi reference iamge and sharpens the histogram |
| 135 | + This workflow takes in a dwi reference image and sharpens the histogram |
136 | 136 | with the application of the N4 algorithm for removing the
|
137 | 137 | :abbr:`INU (intensity non-uniformity)` bias field and calculates a signal
|
138 | 138 | mask.
|
|
0 commit comments