Skip to content

Commit

Permalink
Fix CBF CIFTI generation when --project-goodvoxels is enabled (#460)
Browse files Browse the repository at this point in the history
* Fix CBF CIFTI generation.

* Revert "Fix CBF CIFTI generation."

This reverts commit f56aabf.

* Update test to raise error.

* Reapply "Fix CBF CIFTI generation."

This reverts commit f7583b5.

* Add comments.
  • Loading branch information
tsalo authored Nov 7, 2024
1 parent 763c72b commit 571fd2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aslprep/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def test_test_003_full(data_dir, output_dir, working_dir):
output_dir,
working_dir,
level='full',
extra_params=['--cifti-output', '91k'],
extra_params=['--cifti-output', '91k', '--project-goodvoxels'],
)


Expand Down
5 changes: 4 additions & 1 deletion aslprep/workflows/asl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ def init_asl_wf(
ds_asl_cifti_wf.inputs.inputnode.source_files = [asl_file]
workflow.connect([
(inputnode, ds_asl_cifti_wf, [
('t1w_preproc', 'inputnode.anat'),
('mni6_mask', 'inputnode.mni6_mask'),
('anat2mni6_xfm', 'inputnode.anat2mni6_xfm'),
('white', 'inputnode.white'),
Expand All @@ -780,6 +779,10 @@ def init_asl_wf(
('sphere_reg_fsLR', 'inputnode.sphere_reg_fsLR'),
('cortex_mask', 'inputnode.cortex_mask'),
]),
(asl_anat_wf, ds_asl_cifti_wf, [
# Used for affine/resolution reference only
('outputnode.resampling_reference', 'inputnode.anat_ref_file'),
]),
(asl_fit_wf, ds_asl_cifti_wf, [
('outputnode.aslref2anat_xfm', 'inputnode.aslref2anat_xfm'),
]),
Expand Down
7 changes: 4 additions & 3 deletions aslprep/workflows/asl/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,12 @@ def init_ds_ciftis_wf(
inputnode_fields = [
'asl_cifti',
'source_files',
# Anatomical
'anat',
# ASL-resolution, anatomical-space reference image
'anat_ref_file',
'aslref2anat_xfm',
# Template
'anat2mni6_xfm',
# Template reference image. Resolution depends on CIFTI output resolution
'mni6_mask',
# Pre-computed goodvoxels mask. May be Undefined.
'goodvoxels_mask',
Expand Down Expand Up @@ -927,7 +928,7 @@ def init_ds_ciftis_wf(
workflow.connect([
(inputnode, warp_cbf_to_anat, [
(cbf_deriv, 'input_image'),
('anat', 'reference_image'),
('anat_ref_file', 'reference_image'),
('aslref2anat_xfm', 'transforms'),
]),
]) # fmt:skip
Expand Down

0 comments on commit 571fd2f

Please sign in to comment.