Get center of gravity of a segment

Through the UI, you can import the labelmap as segmentation, turn them into individual segments using island tool, and then use the segment statistics module to get the centroids for each of those segments.

If you will do it more than once, scripting is probably the better approach.

1 Like

Hi muratmaga,
I got the results like this

How can I get the position coordinates for each of the centroide of a segment and then replace it with a fiducial

thank you

regards,
Saima safdar

Hi,
Thanks I found the solution

You can find a complete example of placing markups at segment centroids: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_centroid_of_each_segment

Here is another example, which draws oriented bounding boxes around each segment: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_size.2C_position.2C_and_orientation_of_each_segment

1 Like

Hi Andras,
The electrodes which I extracted now I can represent them with fiducials.

is there a way to project these fiducials onto the brain cortical surface on the T1 MRI? I need to calculate the distance between the projected and actual electrode positions in CT scan.

Any idea how can I get? Can I use the nearest neighbour to find cells on brain and then get cell centroid and convert to fiducials or is there a better way of projecting onto brain surface.

Thank you

Regards,
Saima Safdar

Projection to a curved surface is not a well-defined operation: it can be done many different ways, with slightly different results.

Can you post a few screenshots that show where the electrode positions are, how the cortical surface looks like, and where do you think they should be projected to?

Hi andras,
I am attaching the screen shot.

image

How can I project to surface. The electrodes shown in red are segmented from CT and shown with fiducials

Hi andras,
I need to go for an algorithm that can dynamically picks surface triangles with respect to the electrodes identified from ct of the same patient. I need to do it for multiple patients.

Is there anything I can do to do this automatically.

I need to calculated the displacements of the cells of the brain done during craniotomy and through placing these electrodes.

Thank you

You can get the closest surface point or cell to a markup point as it is shown in these examples:

1 Like

Hi Andras,
I got the selected cells of the model. It is possible to get the centroid for each selected cell.

Thank you

Regards,
Saima Safdar

Hi Andras,
I got it. I got the cell point ids and from there I get three points and then averaging over x axis y axis and z axis. to get the centroid.

Many thanks

1 Like