This is a little confusing to me. Are you trying to find a center for a surface, a patch on a surface or a volume? Surfaces are typically stored in GIFTI files ending in .gii. NIFTI files are most often used with volumetric data. Patches are usually a list of nodes in a niml.dset, 1D.dset, .1D and sometimes in .gii format as a "functional" GIFTI.
We had a poster on different ways to compute centers at last years OHBM.
[
afni.nimh.nih.gov]
If you provide some more detail, I'd be happy to point you in the right direction.