1
1
"""Orchestrating the dMRI-preprocessing workflow."""
2
-
3
2
from nipype import logging
4
-
5
3
from nipype .pipeline import engine as pe
6
4
from nipype .interfaces import utility as niu
7
5
8
6
from niworkflows .engine .workflows import LiterateWorkflow as Workflow
9
-
10
- from ...config import DEFAULT_MEMORY_MIN_GB
11
-
12
- from ...interfaces import DerivativesDataSink
13
7
from ...interfaces .vectors import CheckGradientTable
8
+ from .util import init_dwi_reference_wf
9
+ from .outputs import init_reportlets_wf
14
10
15
11
16
12
LOGGER = logging .getLogger ('nipype.workflow' )
@@ -100,10 +96,9 @@ def init_dwi_preproc_wf(
100
96
See also
101
97
--------
102
98
* :py:func:`~dmriprep.workflows.dwi.util.init_dwi_reference_wf`
99
+ * :py:func:`~dmriprep.workflows.dwi.outputs.init_reportlets_wf`
103
100
104
101
"""
105
- from .util import init_dwi_reference_wf
106
-
107
102
wf_name = _get_wf_name (dwi_file )
108
103
109
104
# Build workflow
@@ -147,7 +142,7 @@ def init_dwi_preproc_wf(
147
142
148
143
gradient_table = pe .Node (CheckGradientTable (), name = 'gradient_table' )
149
144
150
- dwi_reference_wf = init_dwi_reference_wf (omp_nthreads = 1 , gen_report = True )
145
+ dwi_reference_wf = init_dwi_reference_wf (omp_nthreads = 1 )
151
146
152
147
# MAIN WORKFLOW STRUCTURE
153
148
workflow .connect ([
@@ -158,7 +153,7 @@ def init_dwi_preproc_wf(
158
153
(inputnode , dwi_reference_wf , [('dwi_file' , 'inputnode.dwi_file' )]),
159
154
(gradient_table , dwi_reference_wf , [('b0_ixs' , 'inputnode.b0_ixs' )]),
160
155
(dwi_reference_wf , outputnode , [
161
- ('outputnode.dwi_file ' , 'out_dwi' ),
156
+ ('outputnode.ref_image ' , 'out_dwi' ),
162
157
('outputnode.dwi_mask' , 'out_dwi_mask' )]),
163
158
(gradient_table , outputnode , [
164
159
('out_bvec' , 'out_bvec' ),
@@ -167,18 +162,14 @@ def init_dwi_preproc_wf(
167
162
])
168
163
169
164
# REPORTING
170
- ds_report_validation = pe .Node (
171
- DerivativesDataSink (base_directory = reportlets_dir ,
172
- desc = 'validation' , keep_dtype = True ),
173
- name = 'ds_report_validation' , run_without_submitting = True ,
174
- mem_gb = DEFAULT_MEMORY_MIN_GB )
175
-
165
+ reportlets_wf = init_reportlets_wf (reportlets_dir )
176
166
workflow .connect ([
177
- (inputnode , ds_report_validation , [('dwi' , 'source_file' )]),
178
- (dwi_reference_wf , ds_report_validation , [
179
- ('outputnode.validation_report' , 'in_file' )]),
167
+ (inputnode , reportlets_wf , [('dwi_file' , 'inputnode.source_file' )]),
168
+ (dwi_reference_wf , reportlets_wf , [
169
+ ('outputnode.ref_image' , 'inputnode.dwi_ref' ),
170
+ ('outputnode.dwi_mask' , 'inputnode.dwi_mask' ),
171
+ ('outputnode.validation_report' , 'inputnode.validation_report' )]),
180
172
])
181
-
182
173
return workflow
183
174
184
175
0 commit comments