Skip to content

Commit

Permalink
Add subcort-on-atlas figures.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Sep 22, 2023
1 parent da6d866 commit ac3b2c5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions xcp_d/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def init_postprocess_anat_wf(
# fmt:on

execsummary_anatomical_plots_wf = init_execsummary_anatomical_plots_wf(
input_type=input_type,
t1w_available=t1w_available,
t2w_available=t2w_available,
output_dir=output_dir,
Expand Down
41 changes: 39 additions & 2 deletions xcp_d/workflows/execsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ def init_execsummary_functional_plots_wf(

@fill_doc
def init_execsummary_anatomical_plots_wf(
input_type,
t1w_available,
t2w_available,
output_dir,
Expand All @@ -596,6 +597,7 @@ def init_execsummary_anatomical_plots_wf(
from xcp_d.workflows.execsummary import init_execsummary_anatomical_plots_wf
wf = init_execsummary_anatomical_plots_wf(
input_type="nibabies",
t1w_available=True,
t2w_available=True,
output_dir=".",
Expand All @@ -604,6 +606,7 @@ def init_execsummary_anatomical_plots_wf(
Parameters
----------
%(input_type)s
t1w_available : bool
Generally True.
t2w_available : bool
Expand Down Expand Up @@ -684,6 +687,41 @@ def init_execsummary_anatomical_plots_wf(
])
# fmt:on

if input_type == "nibabies":
plot_subcort_on_atlas_wf = init_plot_custom_slices_wf(
output_dir=output_dir,
desc="SubcorticalOnAtlas",
name="plot_subcort_on_atlas_wf",
)

# fmt:off
workflow.connect([
(inputnode, plot_subcort_on_atlas_wf, [
("t1w", "inputnode.name_source"),
("template", "inputnode.overlay_file"),
]),
(resample_t1w, plot_subcort_on_atlas_wf, [
("out_file", "inputnode.underlay_file"),
]),
])
# fmt:on

plot_t1w_on_subcort_wf = init_plot_custom_slices_wf(
output_dir=output_dir,
desc="T1wOnSubcortical",
name="plot_t1w_on_subcort_wf",
)

# fmt:off
workflow.connect([
(inputnode, plot_t1w_on_subcort_wf, [
("t1w", "inputnode.name_source"),
("template", "inputnode.underlay_file"),
]),
(resample_t1w, plot_t1w_on_subcort_wf, [("out_file", "inputnode.overlay_file")]),
])
# fmt:on

# Atlas in T2w, T2w in Atlas
if t2w_available:
# Resample T2w to match resolution of template data
Expand Down Expand Up @@ -751,8 +789,7 @@ def init_plot_custom_slices_wf(
):
"""Plot a custom selection of slices with Slicer.
This workflow is used to produce subcortical registration plots specifically for
infant data.
This workflow is used to produce subcortical registration plots specifically for infant data.
Workflow Graph
.. workflow::
Expand Down

0 comments on commit ac3b2c5

Please sign in to comment.