Hi, when I’m drawing a closed curve on a surface mesh to cut out and create a new surface model, I am receiving the following message:
[Qt] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1
The code I’m using is:
Get input data
curveNode = getNode(‘CC_5’)
modelNode = getNode(‘Segment_1’)
extractLargestPart = False
Get VTK data objects from MRML nodes
curvePoints = curveNode.GetCurvePointsWorld()
meshToClip = modelNode.GetMesh() # we should apply transform to World
Clip model with curve
loop = vtk.vtkSelectPolyData()
loop.SetLoop(curvePoints)
loop.GenerateSelectionScalarsOn()
loop.SetInputData(meshToClip)
loop.SetSelectionModeToLargestRegion()
clip = vtk.vtkClipPolyData()
clip.InsideOutOn()
clip.SetInputConnection(loop.GetOutputPort())
clip.GenerateClippedOutputOn()
clip.Update()
clippedOutput = clip.GetOutput() if extractLargestPart else clip.GetClippedOutput()
connectivity = vtk.vtkConnectivityFilter()
connectivity.SetInputData(clippedOutput)
connectivity.Update()
clippedOutput2 = connectivity.GetOutput()
Remove unused points
cleaner = vtk.vtkCleanPolyData()
cleaner.SetInputData(clippedOutput2)
cleaner.Update()
cleanedClippedOutput = cleaner.GetOutput()
Save result to new node
clippedModel = slicer.modules.models.logic().AddModel(cleanedClippedOutput)
clippedModel.GetDisplayNode().SetActiveScalarName(“”)
clippedModel.GetDisplayNode().BackfaceCullingOff()
Previously I was able to cut the skin surface out but the cut line was not close enough to where it needed to be. Trying again, I am receiving the error message.
Any suggestions?
Thank you.