I have some lines of code based on:
import ExtractCenterline
slicer.util.selectModule(‘ExtractCenterline’)
ec = ExtractCenterline.ExtractCenterlineLogic()
s = segmentationNode.GetSegmentation()
ss = s.GetSegment(s.GetSegmentIdBySegmentName(“aortaCompleta”)).GetRepresentation(‘Closed surface’)
fids = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLMarkupsFiducialNode”)
centerlinePolyData,voronoiDiagramPolyData = ec.extractCenterline(ss, fids)
But I can’t find the centerline after this
I also tryied to modify the ParameterNode
ec.getParameterNode().SetParameter(“InputSurface”, segmentID)
but I don’t know how to see changes on GUI and modify the “Tree” section.
\1. If you wish to work with the logic class of ‘ExtractCenterline’ module, this post is very instructive. The logic class won’t modify the UI in itself.
\2. If you wish to work with the ‘ExtractCenterline’ module’s GUI, you can access all UI widgets this way :
However I don’t know how to change options. Could you give me an example of how to change (for instance) the input surface? I am quite noob with slicer.
You’re right, it should be : ecUI = ecWidgetRepresentation.self().ui
As for slicer.modules.ExtractCenterlineWidget.ui, slicer.modules.ExtractCenterlineWidget is available only if you have shown the ‘ExtractCenterline’ module once, or if you have run slicer.modules.extractcenterline.widgetRepresentation() once. That is, the widget representation needs to be created.