Skip to content

Commit

Permalink
Fix stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Aug 13, 2024
1 parent 4264dd0 commit 982a55c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
25 changes: 21 additions & 4 deletions qsiprep/workflows/anatomical/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,22 +711,39 @@ def init_anat_derivatives_wf(
ds_mni_tpms.inputs.label = ["CSF", "GM", "WM"]

# Transforms
suffix_fmt = "from-{}_to-{}_mode-image_xfm".format
ds_t1_mni_inv_warp = pe.Node(
DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt(template, "T1w")),
DerivativesDataSink(
base_directory=output_dir,
to="T1w",
mode="image",
suffix="xfm",
**{"from": template},
),
name="ds_t1_mni_inv_warp",
run_without_submitting=True,
)

ds_t1_template_transforms = pe.MapNode(
DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt("orig", "T1w")),
DerivativesDataSink(
base_directory=output_dir,
to="T1w",
mode="image",
suffix="xfm",
**{"from": "orig"},
),
iterfield=["source_file", "in_file"],
name="ds_t1_template_transforms",
run_without_submitting=True,
)

ds_t1_mni_warp = pe.Node(
DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt("T1w", template)),
DerivativesDataSink(
base_directory=output_dir,
to=template,
mode="image",
suffix="xfm",
**{"from": "T1w"},
),
name="ds_t1_mni_warp",
run_without_submitting=True,
)
Expand Down
29 changes: 23 additions & 6 deletions qsiprep/workflows/anatomical/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,10 +1105,13 @@ def init_anat_derivatives_wf() -> Workflow:
)

# Transforms
suffix_fmt = "from-{}_to-{}_mode-image_xfm".format
ds_t1_template_transforms = pe.MapNode(
DerivativesDataSink(
base_directory=config.execution.output_dir, suffix=suffix_fmt("orig", "T1w")
base_directory=config.execution.output_dir,
to="T1w",
mode="image",
suffix="xfm",
**{"from": "orig"},
),
iterfield=["source_file", "in_file"],
name="ds_t1_template_transforms",
Expand All @@ -1118,23 +1121,34 @@ def init_anat_derivatives_wf() -> Workflow:
ds_t1_mni_inv_warp = pe.Node(
DerivativesDataSink(
base_directory=config.execution.output_dir,
suffix=suffix_fmt(config.workflow.anatomical_template, "T1w"),
to="T1w",
mode="image",
suffix="xfm",
**{"from": config.workflow.anatomical_template},
),
name="ds_t1_mni_inv_warp",
run_without_submitting=True,
)

ds_t1_template_acpc_transform = pe.Node(
DerivativesDataSink(
base_directory=config.execution.output_dir, suffix=suffix_fmt("T1wNative", "T1wACPC")
base_directory=config.execution.output_dir,
to="T1wACPC",
mode="image",
suffix="xfm",
**{"from": "T1wNative"},
),
name="ds_t1_template_acpc_transforms",
run_without_submitting=True,
)

ds_t1_template_acpc_inv_transform = pe.Node(
DerivativesDataSink(
base_directory=config.execution.output_dir, suffix=suffix_fmt("T1wACPC", "T1wNative")
base_directory=config.execution.output_dir,
to="T1wNative",
mode="image",
suffix="xfm",
**{"from": "T1wACPC"},
),
name="ds_t1_template_acpc_inv_transforms",
run_without_submitting=True,
Expand All @@ -1143,7 +1157,10 @@ def init_anat_derivatives_wf() -> Workflow:
ds_t1_mni_warp = pe.Node(
DerivativesDataSink(
base_directory=config.execution.output_dir,
suffix=suffix_fmt("T1w", config.workflow.anatomical_template),
to=config.workflow.anatomical_template,
mode="image",
suffix="xfm",
**{"from": "T1w"},
),
name="ds_t1_mni_warp",
run_without_submitting=True,
Expand Down

0 comments on commit 982a55c

Please sign in to comment.