Extracting coordinates of muscle segmented on all slices from MRI scans

If you have only two coordinates you should use something like appears on this post

If you have 1 slice only you dhould add a 0 to the third coordinate