How to calculate the sphericity of a Nifti mask?

Hi all,

I would like to calculate the sphericity of a Nifti mask. I can get the volume using fslstats, but after searching wide and far across various neuroimaging platforms, I do not see a way to calculate the surface area of a Nifti mask, which is a required part of the formula for sphericity. My masks are non-regular, hence regular polygon equations would not work.

Is there any software package which could calculate the surface area or sphericity of a Nifti mask?

Basically, you need the volume and surface area of a mask given that formula. Alternatively, you could probably generate a similar measure with volume, equivalent radius, and some count of voxels inside and outside the equivalent sphere. See this previous discussion on brain radius:

You can compute surface area by transform a volume or mask into a quick surface by using the command IsoSurface in AFNI. Then compute the nodal and total surface area with SurfMeasures as shown here.

IsoSurface -isorange 1 255 -input ~/abin/TT_N27+tlrc -o TT_N27_quicksurf.gii

quickspec -spec quick.spec -tn gii TT_N27_quicksurf.gii 

SurfMeasures -spec quick.spec -surf_A TT_N27_quicksurf.gii -info_area -out area -overwrite -func n_area_A 
----------------------------------------------------------
-- total area 0 = 100976.0
3dBrickStat -sum area.niml.dset'[1]'
100976        

Also see these previous threads:

1 Like

Thank you! This is very helpful