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.
import SegmentGeometry SegGeoLogic = SegmentGeometry.SegmentGeometryLogic() SegGeoLogic.getParameterNode().SetParameter(volumeName, sourceNode.GetID()) slicer.modules.SegmentGeometryWidget.onPrincipalAxes()
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!