Howto get a centroid of a section in a slice?

I want to weight the centroid obtained above by the reciprocal of voxel (CT value), how to do it?