Skip to content

Commit

Permalink
Make Sources an iterfield.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Oct 11, 2023
1 parent caa9b15 commit f948750
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
15 changes: 0 additions & 15 deletions xcp_d/interfaces/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@ class _InferBIDSURIsOutputSpec(TraitedSpec):
bids_uris = traits.List(desc="Merged output")


def _ravel(in_val):
if not isinstance(in_val, list):
return in_val

flat_list = []
for val in in_val:
raveled_val = _ravel(val)
if isinstance(raveled_val, list):
flat_list.extend(raveled_val)
else:
flat_list.append(raveled_val)

return flat_list


class InferBIDSURIs(IOBase):
"""Basic interface class to merge inputs into a single list and infer BIDS URIs."""

Expand Down
4 changes: 2 additions & 2 deletions xcp_d/workflows/concatenation.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def init_concatenate_data_wf(
name="ds_timeseries",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)

# fmt:off
Expand Down Expand Up @@ -378,7 +378,7 @@ def init_concatenate_data_wf(
name="ds_timeseries_cifti_files",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)

# fmt:off
Expand Down
14 changes: 7 additions & 7 deletions xcp_d/workflows/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def init_postproc_derivatives_wf(
(preproc_bold_src, merge_dense_src, [("bids_uris", "in1")]),
(preproc_confounds_src, merge_dense_src, [("bids_uris", "in2")]),
])
# fmt:off
# fmt:on

merge_parcellated_src = pe.MapNode(
niu.Merge(numinputs=3),
Expand All @@ -362,7 +362,7 @@ def init_postproc_derivatives_wf(
(preproc_confounds_src, merge_parcellated_src, [("bids_uris", "in2")]),
(atlas_src, merge_parcellated_src, [("bids_uris", "in3")]),
])
# fmt:off
# fmt:on

ds_temporal_mask = pe.Node(
DerivativesDataSink(
Expand Down Expand Up @@ -445,7 +445,7 @@ def init_postproc_derivatives_wf(
name="ds_coverage_files",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)
ds_timeseries = pe.MapNode(
DerivativesDataSink(
Expand All @@ -459,7 +459,7 @@ def init_postproc_derivatives_wf(
name="ds_timeseries",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)
ds_correlations = pe.MapNode(
DerivativesDataSink(
Expand All @@ -474,7 +474,7 @@ def init_postproc_derivatives_wf(
name="ds_correlations",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)

for i_exact_scan, exact_scan in enumerate(exact_scans):
Expand Down Expand Up @@ -524,7 +524,7 @@ def init_postproc_derivatives_wf(
name="ds_parcellated_reho",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)

# fmt:off
Expand Down Expand Up @@ -566,7 +566,7 @@ def init_postproc_derivatives_wf(
name="ds_parcellated_alff",
run_without_submitting=True,
mem_gb=1,
iterfield=["atlas", "in_file"],
iterfield=["atlas", "in_file", "Sources"],
)

# fmt:off
Expand Down

0 comments on commit f948750

Please sign in to comment.