Using SUMA Draw ROI function to edit niml.dset file

Hello,

I created resection masks in volumetric space and transformed them to surface-space on the std.141 mesh using 3dVol2Surf. Before using 3dVol2Surf, I also applied 3dmask_tool with the -fill_holes flag and -dilate_result 2. Most of my masks look really good but they are not perfect, which is totally expected.This is not AFNI or SUMA’s fault; it is actually my own human error in validating the masks which were created through machine-learning. I have attached 2 sample photos. In one case you can see an erroneous dot that should not have been part of the resection. In the other image, there are some small holes along the resected gyrus. I know how to use the draw dataset plug-in in AFNI to modify the resection.nii file before transforming it onto the surface. This is a very useful tool. However, is there a way to modify the niml.dset file directly using a similar tool in SUMA? I have tried using the draw ROI function under tools, but whenever I set a value of 0 or 1 and draw a region to modify the resection.niml.dset file, it instead creates a new ROI file. How can I directly paint on the mesh to modify this niml.dset file? If there is no way to do this, what would be the best way to fill in these holes or remove erroneous parts?

Thanks for your help!

Screen Shot 2022-02-02 at 1.14.51 PM.png

Screen Shot 2022-02-02 at 1.15.01 PM.png

The surface ROIs don’t directly modify the niml.dset files, but there is a much simpler way. SurfLocalstat can be used with the “-stat mode” option to find the mode, the most common vertex value, in a neighborhood around every node. See example 3 in the help for SurfLocalstat. You can also do the equivalent in the volume with “3dLocalstat -stat mode”. The ROI may already be broken in the volume, and that “modal smoothing” can be used to fix it. Also see @ROI_decluster for removing smaller, non-contiguous clusters.

Thanks for the advice. SurfLocalstat did the job!