@@ -193,14 +193,7 @@ def init_func_preproc_wf(bold_file, spaces, has_fieldmap=False, existing_derivat
193
193
freesurfer = config .workflow .run_reconall
194
194
nibabies_dir = str (config .execution .nibabies_dir )
195
195
freesurfer_spaces = spaces .get_fs_spaces ()
196
- project_goodvoxels = config .workflow .project_goodvoxels
197
-
198
- if project_goodvoxels and freesurfer_spaces != ["fsaverage" ]:
199
- config .loggers .workflow .critical (
200
- f"--project-goodvoxels only works with fsaverage (requested: { freesurfer_spaces } )"
201
- )
202
- config .loggers .workflow .warn ("Disabling --project-goodvoxels" )
203
- project_goodvoxels = False
196
+ project_goodvoxels = config .workflow .project_goodvoxels and config .workflow .cifti_output
204
197
205
198
# Extract BIDS entities and metadata from BOLD file(s)
206
199
entities = extract_entities (bold_file )
@@ -344,6 +337,9 @@ def init_func_preproc_wf(bold_file, spaces, has_fieldmap=False, existing_derivat
344
337
"fsnative2t1w_xfm" ,
345
338
"subject_id" ,
346
339
"subjects_dir" ,
340
+ "surfaces" ,
341
+ "morphometrics" ,
342
+ "sphere_reg_fsLR" ,
347
343
]
348
344
),
349
345
name = "inputnode" ,
@@ -929,7 +925,6 @@ def init_func_preproc_wf(bold_file, spaces, has_fieldmap=False, existing_derivat
929
925
mem_gb = mem_gb ["resampled" ],
930
926
surface_spaces = freesurfer_spaces ,
931
927
medial_surface_nan = config .workflow .medial_surface_nan ,
932
- project_goodvoxels = project_goodvoxels ,
933
928
surface_recon_method = config .workflow .surface_recon_method ,
934
929
name = "bold_surf_wf" ,
935
930
)
@@ -938,67 +933,83 @@ def init_func_preproc_wf(bold_file, spaces, has_fieldmap=False, existing_derivat
938
933
(inputnode , bold_surf_wf , [
939
934
('subjects_dir' , 'inputnode.subjects_dir' ),
940
935
('subject_id' , 'inputnode.subject_id' ),
941
- ('t1w2fsnative_xfm' , 'inputnode.t1w2fsnative_xfm' ),
942
- ("anat_ribbon" , "inputnode.anat_ribbon" ),
943
- ("anat_mask" , "inputnode.t1w_mask" )]),
936
+ ('t1w2fsnative_xfm' , 'inputnode.t1w2fsnative_xfm' )]),
944
937
(bold_t1_trans_wf , bold_surf_wf , [('outputnode.bold_t1' , 'inputnode.source_file' )]),
945
938
(bold_surf_wf , outputnode , [('outputnode.surfaces' , 'surfaces' )]),
946
939
(bold_surf_wf , func_derivatives_wf , [
947
940
('outputnode.target' , 'inputnode.surf_refs' )]),
948
- (bold_surf_wf , func_derivatives_wf , [("outputnode.goodvoxels_ribbon" ,
949
- "inputnode.goodvoxels_ribbon" )]),
950
941
])
951
942
# fmt:on
952
943
953
- # CIFTI output
954
- if config .workflow .cifti_output :
955
- from .alignment import (
956
- init_subcortical_mni_alignment_wf ,
957
- init_subcortical_rois_wf ,
958
- )
959
- from .resampling import init_bold_grayords_wf
960
-
961
- key = get_MNIInfant_key (spaces )
962
-
963
- # BOLD/ROIs should be in MNIInfant space
964
- cifti_select_std = pe .Node (
965
- KeySelect (fields = ["bold_std" , "bold_aseg_std" ], key = key ),
966
- name = "cifti_select_std" ,
967
- run_without_submitting = True ,
968
- )
969
-
970
- subcortical_rois_wf = init_subcortical_rois_wf ()
971
- subcortical_mni_alignment_wf = init_subcortical_mni_alignment_wf ()
972
- bold_grayords_wf = init_bold_grayords_wf (
973
- grayord_density = config .workflow .cifti_output ,
974
- mem_gb = mem_gb ["resampled" ],
975
- repetition_time = metadata ["RepetitionTime" ],
976
- )
944
+ # CIFTI output
945
+ if config .workflow .cifti_output :
946
+ from .alignment import (
947
+ init_subcortical_mni_alignment_wf ,
948
+ init_subcortical_rois_wf ,
949
+ )
950
+ from .resampling import init_bold_fsLR_resampling_wf , init_bold_grayords_wf
951
+
952
+ # key = get_MNIInfant_key(spaces)
953
+ # # BOLD/ROIs should be in MNIInfant space
954
+ # cifti_select_std = pe.Node(
955
+ # KeySelect(fields=["bold_std", "bold_aseg_std"], key=key),
956
+ # name="cifti_select_std",
957
+ # run_without_submitting=True,
958
+ # )
959
+
960
+ subcortical_rois_wf = init_subcortical_rois_wf ()
961
+ subcortical_mni_alignment_wf = init_subcortical_mni_alignment_wf ()
962
+ bold_grayords_wf = init_bold_grayords_wf (
963
+ grayord_density = config .workflow .cifti_output ,
964
+ mem_gb = mem_gb ["resampled" ],
965
+ repetition_time = metadata ["RepetitionTime" ],
966
+ )
977
967
978
- # fmt:off
979
- workflow .connect ([
980
- (bold_std_trans_wf , cifti_select_std , [
981
- ("outputnode.bold_std" , "bold_std" ),
982
- ("outputnode.bold_aseg_std" , "bold_aseg_std" ),
983
- ("outputnode.spatial_reference" , "keys" )]),
984
- (cifti_select_std , subcortical_rois_wf , [
985
- ("bold_aseg_std" , "inputnode.MNIInfant_aseg" )]),
986
- (cifti_select_std , subcortical_mni_alignment_wf , [
987
- ("bold_std" , "inputnode.MNIInfant_bold" )]),
988
- (subcortical_rois_wf , subcortical_mni_alignment_wf , [
989
- ("outputnode.MNIInfant_rois" , "inputnode.MNIInfant_rois" ),
990
- ("outputnode.MNI152_rois" , "inputnode.MNI152_rois" )]),
991
- (subcortical_mni_alignment_wf , bold_grayords_wf , [
992
- ("outputnode.subcortical_volume" , "inputnode.subcortical_volume" ),
993
- ("outputnode.subcortical_labels" , "inputnode.subcortical_labels" )]),
994
- (bold_surf_wf , bold_grayords_wf , [
995
- ('outputnode.surfaces' , 'inputnode.surf_files' ),
996
- ('outputnode.target' , 'inputnode.surf_refs' )]),
997
- (bold_grayords_wf , outputnode , [
998
- ('outputnode.cifti_bold' , 'bold_cifti' ),
999
- ('outputnode.cifti_metadata' , 'cifti_metadata' )]),
1000
- ])
1001
- # fmt:on
968
+ # fmt:off
969
+ workflow .connect ([
970
+ (inputnode , bold_fsLR_resampling_wf , [
971
+ ("surfaces" , "inputnode.surfaces" ),
972
+ ("morphometrics" , "inputnode.morphometrics" ),
973
+ ("sphere_reg_fsLR" , "inputnode.sphere_reg_fsLR" ),
974
+ ("anat_ribbon" , "inputnode.anat_ribbon" )]),
975
+ # (bold_std_trans_wf, cifti_select_std, [
976
+ # ("outputnode.bold_std", "bold_std"),
977
+ # ("outputnode.bold_aseg_std", "bold_aseg_std"),
978
+ # ("outputnode.spatial_reference", "keys")]),
979
+ # (cifti_select_std, subcortical_rois_wf, [
980
+ # ("bold_aseg_std", "inputnode.MNIInfant_aseg")]),
981
+ # (cifti_select_std, subcortical_mni_alignment_wf, [
982
+ # ("bold_std", "inputnode.MNIInfant_bold")]),
983
+ # (subcortical_rois_wf, subcortical_mni_alignment_wf, [
984
+ # ("outputnode.MNIInfant_rois", "inputnode.MNIInfant_rois"),
985
+ # ("outputnode.MNI152_rois", "inputnode.MNI152_rois")]),
986
+ # (subcortical_mni_alignment_wf, bold_grayords_wf, [
987
+ # ("outputnode.subcortical_volume", "inputnode.subcortical_volume"),
988
+ # ("outputnode.subcortical_labels", "inputnode.subcortical_labels")]),
989
+ # (bold_surf_wf, bold_grayords_wf, [
990
+ # ('outputnode.surfaces', 'inputnode.surf_files'),
991
+ # ('outputnode.target', 'inputnode.surf_refs')]),
992
+ (bold_t1_trans_wf , bold_fsLR_resampling_wf , [
993
+ ("outputnode.bold_t1" , "inputnode.bold_file" )]),
994
+ (bold_std_trans_wf , bold_grayords_wf , [
995
+ ("outputnode.bold_std" , "inputnode.bold_std" ),
996
+ ("outputnode.spatial_reference" , "inputnode.spatial_reference" ),
997
+ ]),
998
+ (bold_fsLR_resampling_wf , bold_grayords_wf , [
999
+ ("outputnode.bold_fsLR" , "inputnode.bold_fsLR" ),
1000
+ ]),
1001
+ (bold_fsLR_resampling_wf , func_derivatives_wf , [
1002
+ ("outputnode.goodvoxels_mask" , "inputnode.goodvoxels_mask" ),
1003
+ ]),
1004
+ (bold_grayords_wf , outputnode , [
1005
+ ("outputnode.cifti_bold" , "bold_cifti" ),
1006
+ ("outputnode.cifti_metadata" , "cifti_metadata" ),
1007
+ ]),
1008
+ (bold_grayords_wf , outputnode , [
1009
+ ('outputnode.cifti_bold' , 'bold_cifti' ),
1010
+ ('outputnode.cifti_metadata' , 'cifti_metadata' )]),
1011
+ ])
1012
+ # fmt:on
1002
1013
1003
1014
if spaces .get_spaces (nonstandard = False , dim = (3 ,)):
1004
1015
if not config .workflow .cifti_output :
0 commit comments