Hello~!
I was trying to use Segment Geometry using python interactor.
I figure out how to get the statistic data but could not make the transformation to work.
I tried below script and got following error message.
Traceback (most recent call last):
File “”, line 1, in
File “C:/Users/njy95/AppData/Local/NA-MIC/Slicer 5.1.0-2022-09-27/NA-MIC/Extensions-31161/SegmentGeometry/lib/Slicer-5.1/qt-scripted-modules/SegmentGeometry.py”, line 395, in onPrincipalAxes
segName = segmentationNode.GetName()
AttributeError: ‘NoneType’ object has no attribute ‘GetName’
I thought I did setup Segmentation node for the transformation, so I cannot figure out what went wrong!
I will be glad to hear any advice on how to use the onPrincipalAxes for the Segment Geometry Transformation.
Thank you in advance!
I’ll admit that I have not tested how well SegmentGeometry works using the python terminal. I will see if I can get to the root of the problem and get back to you @hourglassnam.
When using the sample data for SegmentGeometry, this chunk of code worked for me. Give this ago and let me know if it doesn’t work. You’ll need to define the volumenode, the segmentation node, and the segment you want to use.