Skip to content

Commit 259356b

Browse files
committed
Something like this?
1 parent a75ba6a commit 259356b

File tree

1 file changed

+25
-19
lines changed
  • src/fmripost_aroma/workflows

1 file changed

+25
-19
lines changed

src/fmripost_aroma/workflows/base.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ def init_single_subject_wf(subject_id: str):
318318
"""
319319

320320
for bold_file in subject_data["bold"]:
321+
ica_aroma_wf = init_ica_aroma_wf(bold_file=bold_file)
322+
ica_aroma_wf.__desc__ = func_pre_desc + (ica_aroma_wf.__desc__ or "")
323+
321324
functional_cache = {}
322325
if config.execution.derivatives:
323326
# Collect native-space derivatives and warp them to MNI152NLin6Asym
@@ -332,30 +335,33 @@ def init_single_subject_wf(subject_id: str):
332335
entities=entities,
333336
)
334337
)
338+
339+
resample_raw_wf = init_resample_raw_wf(
340+
bold_file=bold_file,
341+
precomputed=functional_cache,
342+
)
343+
workflow.connect([
344+
(resample_raw_wf, ica_aroma_wf, [
345+
("outputnode.bold_std", "inputnode.bold_std"),
346+
("outputnode.bold_mask_std", "inputnode.bold_mask_std"),
347+
]),
348+
]) # fmt:skip
335349
else:
336350
# Collect standard-space derivatives
337351
from fmripost_aroma.utils.bids import collect_derivatives
338352

339-
...
340-
341-
ica_aroma_wf = init_ica_aroma_wf(
342-
bold_file=bold_file,
343-
precomputed=functional_cache,
344-
)
345-
ica_aroma_wf.__desc__ = func_pre_desc + (ica_aroma_wf.__desc__ or "")
353+
functional_cache.update(
354+
collect_derivatives(
355+
derivatives_dir=deriv_dir,
356+
entities=entities,
357+
)
358+
)
359+
ica_aroma_wf.inputs.inputnode.bold_std = functional_cache["bold_std"]
360+
ica_aroma_wf.inputs.inputnode.bold_mask_std = functional_cache["bold_mask_std"]
346361

347-
# fmt:off
348-
workflow.connect([
349-
(inputnode, ica_aroma_wf, [
350-
('bold_std', 'inputnode.bold_std'),
351-
("bold_mask_std", "inputnode.bold_mask_std"),
352-
("movpar_file", "inputnode.movpar_file"),
353-
("name_source", "inputnode.name_source"),
354-
("skip_vols", "inputnode.skip_vols"),
355-
("spatial_reference", "inputnode.spatial_reference"),
356-
]),
357-
])
358-
# fmt:on
362+
ica_aroma_wf.inputs.inputnode.movpar_file = functional_cache["movpar_file"]
363+
ica_aroma_wf.inputs.inputnode.skip_vols = functional_cache["skip_vols"]
364+
ica_aroma_wf.inputs.inputnode.spatial_reference = functional_cache["spatial_reference"]
359365

360366
return clean_datasinks(workflow)
361367

0 commit comments

Comments
 (0)