Python - Editing Feature Size Local Threshold

@lassoan

I am sorry to bother you again. I copied all of the functions from the Local Threshold into the Python Interactor and created a segmentationNode around a pre-determined point. Then, I run this code:

segmentEditorWidget = slicer.modules.segmenteditor.widgetRepresentation().self().editor
segmentEditorWidget.setActiveEffectByName(“Local Threshold”)
effect.setParameter(“Minimum Threshold”, 265)
effect.setParameter(“Maximum Threshold”, 1009)
effect = segmentEditorWidget.activeEffect()
ijkPoints = vtk.vtkPoints()
ijkPoints.InsertNextPoint(world[0], world[1], world[2]) ##world has the coordinates of the point
effect.self().apply(ijkPoints)

This gives me an error saying that “None Type” has no attribute self. I feel like we have the necessary elements to the code(many thanks to your GitHub resources), but I just cannot get the code to actually work when run. Thank you

1 Like