Skip to content

Commit 571fd2f

Browse files
authored
Fix CBF CIFTI generation when --project-goodvoxels is enabled (#460)
* 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.
1 parent 763c72b commit 571fd2f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

aslprep/tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_test_003_full(data_dir, output_dir, working_dir):
355355
output_dir,
356356
working_dir,
357357
level='full',
358-
extra_params=['--cifti-output', '91k'],
358+
extra_params=['--cifti-output', '91k', '--project-goodvoxels'],
359359
)
360360

361361

aslprep/workflows/asl/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ def init_asl_wf(
770770
ds_asl_cifti_wf.inputs.inputnode.source_files = [asl_file]
771771
workflow.connect([
772772
(inputnode, ds_asl_cifti_wf, [
773-
('t1w_preproc', 'inputnode.anat'),
774773
('mni6_mask', 'inputnode.mni6_mask'),
775774
('anat2mni6_xfm', 'inputnode.anat2mni6_xfm'),
776775
('white', 'inputnode.white'),
@@ -780,6 +779,10 @@ def init_asl_wf(
780779
('sphere_reg_fsLR', 'inputnode.sphere_reg_fsLR'),
781780
('cortex_mask', 'inputnode.cortex_mask'),
782781
]),
782+
(asl_anat_wf, ds_asl_cifti_wf, [
783+
# Used for affine/resolution reference only
784+
('outputnode.resampling_reference', 'inputnode.anat_ref_file'),
785+
]),
783786
(asl_fit_wf, ds_asl_cifti_wf, [
784787
('outputnode.aslref2anat_xfm', 'inputnode.aslref2anat_xfm'),
785788
]),

aslprep/workflows/asl/outputs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,12 @@ def init_ds_ciftis_wf(
837837
inputnode_fields = [
838838
'asl_cifti',
839839
'source_files',
840-
# Anatomical
841-
'anat',
840+
# ASL-resolution, anatomical-space reference image
841+
'anat_ref_file',
842842
'aslref2anat_xfm',
843843
# Template
844844
'anat2mni6_xfm',
845+
# Template reference image. Resolution depends on CIFTI output resolution
845846
'mni6_mask',
846847
# Pre-computed goodvoxels mask. May be Undefined.
847848
'goodvoxels_mask',
@@ -927,7 +928,7 @@ def init_ds_ciftis_wf(
927928
workflow.connect([
928929
(inputnode, warp_cbf_to_anat, [
929930
(cbf_deriv, 'input_image'),
930-
('anat', 'reference_image'),
931+
('anat_ref_file', 'reference_image'),
931932
('aslref2anat_xfm', 'transforms'),
932933
]),
933934
]) # fmt:skip

0 commit comments

Comments
 (0)