3dVol2Surf for nifti conversion

Hello,

I am trying to make a binary nifti (image included) into a surface dataset or gifti file. I'm having issues applying 3dVol2Surf correctly. Here is my attempt:

3dVol2Surf
-spec SUMA/std.60.sub-p130_ses-clinical_rh.spec
-surf_A SUMA/std.60.rh.smoothwm.gii
-map_func mask
-sv resected_elec.nii
-grid_parent resected_elec.nii
-out_niml test_surf.niml.dset

but I am getting

** surface name '/Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii' not found, though I know the path is correct and the surface (created using SUMA_Make_Spec_FS) been used for many things successfully. I would like to know if there are other issues with my approach, though I was trying to mirror this answer (change volume ROI to surface dset), and additionally whether a binary nifti should be the sv AND the grid_parent, or if I should be using the SurfVol.

Thank you!

Hello,

Just to be sure does 'ls' see that file?

ls -l /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii

The -grid_parent dataset (the odd option name being named based on the 3dSurf2Vol direction) is where the mapped data would come from, which looks good here.
The -sv dataset should be the surface volume that the surfaces were based on. It can be the SurfVol.nii in the SUMA directory, or one output by @SUMA_AlignToExperiment, if you have run that. It looks like the -sv option was not used quite correctly in the post you reference. Thanks for the link.
-rick

Hi Rick,

Yes, the file is found.

(base) ndsd-neu-srle:p130 srinivasanl2$ ls -l /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii

-rwxrwx---+ 1 srinivasanl2 NIH\Domain Users 1730817 Jun 23 2023 /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii

I am still getting the same error after swapping for the SurfVol. I will include the full command underneath the more reader friendly version.

3dVol2Surf
-spec SUMA/std.60.sub-p130_ses-clinical_rh.spec
-surf_A SUMA/std.60.rh.smoothwm.gii
-map_func mask
-sv SUMA/sub-p130_ses-clinical_SurfVol.nii
-grid_parent resected_elec.nii
-out_niml test_surf.niml.dset

(base) ndsd-neu-srle:p130 srinivasanl2$ 3dVol2Surf -spec /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.sub-p130_ses-clinical_rh.spec -surf_A /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii -map_func mask -sv /Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/sub-p130_ses-clinical_SurfVol.nii -grid_parent /Volumes/Shares/NEU/Users/Leela/meg_ieeg/p130/resected_elec.nii -out_niml test_surf.niml.dset

** surface name '/Volumes/Shares/NEU/Data/derivatives/freesurfer-6.0.0/sub-p130_ses-clinical/SUMA/std.60.rh.smoothwm.gii' not found

I was slightly wary of using the rh spec/smoothwm files when my dataset resected_elec.nii covers the whole brain, but I only have a smoothwm file for each hemi. Let me know if you have any ideas.

Thank you for the help!

I think only the spec file needs the path, and any surf_A/B would be relative to that.
So try even: -surf_A smoothwm
The path, std.60, rh and gii would be implied by the spec file.
-rick

Hi Rick,

The paths were likely the issue and the program executes now, but unfortunately produces an empty dataset.

Could that have anything to do with my nifti being binary? I thought mask seemed like the appropriate -map_func argument but I wonder if that is the issue.

Thanks!
Leela

Hello,

I was wondering what you might see. From your image, the red dots seem completely outside the brain (not just the smoothwm, but outside the pial). But your 3dVol2Surf command is looking for things that intersect with the smoothwm surface. So it seems reasonable for the surface mapping to be empty.

But that means you might need to revisit the goal. Since those red spots do not actually touch the surface, perhaps you want something along the lines of finding the closest node on the surface.

These are things that Daniel usually figures out, though he is away for a while. But one option might be to use something like "SurfToSurf -output_params NearstNode", to find the nearest node on the surface, and to possibly grow from there.

-rick