Extract Center of masses from binary LabelMapVolume and convert to Fiducials?

Hi Slicer developers

I have a binary labelMapVolume (512x512x173). It contains a large number of regions almost circular (approximately each area of about 20 pixels) at its axial sections.

I have two questions:
1- How can I determine the center of masses these regions as a pixel, separately?
2- How can I convert these center of masses to fiducials?

Please guide me,
Thanks a lot.

You can use Islands effect to split the segment so that each island is put in a separate segment. You can then use numpy or VTK or SimpleITK to compute center of gravity.

You may also find SimpleITK or vtkITK label filters to get island properties directly from the original (non-split) labelmap image.

@shahrokh as you find a good working solutions for your questions please post them so others can benefit.