I am trying to get data that I post-processed with my own pipeline after running fmriprep into fsLR32k space. I have tried using workbench and neuromaps with freesurfer, which has resulted in a variety of problems I haven’t been able to solve. I would love to be able to use the fmriprep resampling workflow I found here, but I am not familiar with nipype. Does anyone have any examples handy of applying init_bold_fsLR_resampling_wf
independently of fmriprep? I have my BOLD data output into T1w and MNI152NLin6Asym spaces.
I’ve made some progress, but am having trouble figuring out which files correspond to the following inputs: midthickness_fsLR
, and cortex_mask
. I also included the following flags when I ran fmriprep: --output-spaces fsLR
and --cifti-output 91k
.
from fmriprep.workflows.bold.resampling import init_bold_fsLR_resampling_wf
bold_file = fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/func/sub-'+subid+'_sub-'+sesid+'_task-rest_bold_space-T1w_preproc.nii.gz'
white = [
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-L_white.surf.gii',
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-R_white.surf.gii'
]
pial = [
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-L_pial.surf.gii',
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-R_pial.surf.gii'
]
midthickness = [
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-L_midthickness.surf.gii',
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-R_midthickness.surf.gii'
]
midthickness_fsLR = [
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_space-fsLR_den-91k_thickness.dscalar.nii',
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_space-fsLR_den-91k_thickness.dscalar.nii'
] # Jan 10, 2024: don't see anything distinction between left and right here... prob not the right files
sphere_reg_fsLR = [
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-L_space-fsLR_desc-reg_sphere.surf.gii',
fmriprep_output_dir+'/sub-'+subid+'/ses-'+sesid+'/anat/sub-'+subid+'_sub-'+sesid+'_hemi-R_space-fsLR_desc-reg_sphere.surf.gii'
] # Jan 10, 2024: Not clear if it is a registration from T1w to fsLR, or visa versa
cortex_mask = [] # Jan 10, 2024: Can only find a brain mask. Where would a cortex mask be?
# Initialize and configure the fsLR resampling workflow
fsLR_wf = init_bold_fsLR_resampling_wf(
mem_gb=3, # Adjust memory usage according to your system's capability
omp_nthreads=1, # Number of threads
spaces=['fsLR'] # Target space
)
# Configure inputs
fsLR_wf.inputs.inputnode.bold_file = str(bold_file)
fsLR_wf.inputs.inputnode.white = white
fsLR_wf.inputs.inputnode.pial = pial
fsLR_wf.inputs.inputnode.midthickness = midthickness
fsLR_wf.inputs.inputnode.midthickness_fsLR = midthickness_fsLR
fsLR_wf.inputs.inputnode.sphere_reg_fsLR = sphere_reg_fsLR
fsLR_wf.inputs.inputnode.cortex_mask = cortex_mask
fsLR_wf.inputs.inputnode.volume_roi = volume_roi
# Run the workflow
fsLR_wf.base_dir = str(output_dir)
fsLR_wf.run()