Skip to content

Commit

Permalink
Make registration figure in executive summary optional (PennLINC#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Oct 27, 2023
1 parent 793a9ce commit 4ec3282
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: 2

build:
os: ubuntu-22.04
apt_packages:
- graphviz
tools:
python: "3.8"

Expand Down
36 changes: 20 additions & 16 deletions xcp_d/workflows/execsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,24 +384,28 @@ def init_execsummary_functional_plots_wf(
suffix="bold",
return_type="file",
)
bold_t1w_registration_file = fnmatch.filter(
bold_t1w_registration_files,
f"*/{bb_register_prefix}*",
)[0]
if not bold_t1w_registration_files:
LOGGER.warning("No coregistration figure found in preprocessing derivatives.")
else:
# TODO: Switch to interface
bold_t1w_registration_file = fnmatch.filter(
bold_t1w_registration_files,
f"*/{bb_register_prefix}*",
)[0]

ds_registration_figure = pe.Node(
DerivativesDataSink(
base_directory=output_dir,
in_file=bold_t1w_registration_file,
dismiss_entities=["den"],
datatype="figures",
desc="bbregister",
),
name="ds_registration_figure",
run_without_submitting=True,
)
ds_registration_figure = pe.Node(
DerivativesDataSink(
base_directory=output_dir,
in_file=bold_t1w_registration_file,
dismiss_entities=["den"],
datatype="figures",
desc="bbregister",
),
name="ds_registration_figure",
run_without_submitting=True,
)

workflow.connect([(inputnode, ds_registration_figure, [("preproc_nifti", "source_file")])])
workflow.connect([(inputnode, ds_registration_figure, [("preproc_nifti", "source_file")])])

# Calculate the mean bold image
calculate_mean_bold = pe.Node(
Expand Down

0 comments on commit 4ec3282

Please sign in to comment.