Howto get a centroid of a section in a slice?

I want to get each centroid of the pedicle sections in green slice(as shown below) by code.

Place fiducial at centroid of current slice - Support - 3D Slicer Community
Get Centroid from Script
Centroid determination
@lassoan@Juicy@jamesobutler @jcfr @pieper@ jmhuie @manjula @szhang

You can get the current slice image from the slice logic of the slice widget at shown in this example.

However, probably you can get the ideal pedicle screw axis position and orientation directly in 3D by segmenting a pedicle. It can be as simple as Paint a sphere with “Editable intensity range” set to bone. You could further improve result by applying Island effect → Extract largest island. To fill the internal holes in the segment you can use Wrap Solidify effect. You can get the axis position and direction of this bone segment using Segment Statistics module. You can get the centerline curve of the pedicle using VMTK extension’s Extract centerline module.

我没有看懂这个例子

I didn’t understand this example. :cold_sweat:

由于一些骨质疏松等的特殊病例,segmenting椎弓根with script总是不理想。

Due to some special cases such as osteoporosis, segmenting a pedicle with script is not always ideal.

我一直在探索影像学意义上的理想的椎弓根的轴,利用Slicer以及像VMTK这样的插件。。。可是因为上面提到的原因,没成功 :cold_sweat: :imp:

I’ve been exploring the ideal pedicle axis in the imaging sense, using Slicer and plugins like VMTK. . . However, for the reasons mentioned above, it was unsuccessful.

老师您的意思👆🏻是说,多边形各顶点坐标的`np.average()'就是这个多边形的质心吗?

Teacher, do you mean :point_up_2:t2: that the `np.average()’ of the coordinates of each vertex of the polygon is the centroid of the polygon?

well,现在的问题就转化成了如何提取当前界面某个多边形的顶点坐标。。。

Well, the current question now becomes how to extract the vertex coordinates of a polygon of the current section. . .

Yes, I know that segmentation of the pedicle is often not trivial, but there are many Segment Editor tools that can help with this. You could also train a neural network using MONAILabel extension to segment the pedicles fully automatically.

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

:point_up_2:t2:这个不完美

完美截出轮廓,找到质心。。。

fromhelperFunctions.py

1 Like