Error message:[Qt] ctkSliderWidget::setSingleStep() 0 is out of bounds. 0 100 1

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.


The problem is having a green segmentation under the red model. I was hoping to use the green segmentation as a guide to show me where to cut the skin. The closed curve created can not find the red model to cut the surface model. If I turn off the green segmentation off I can cut the red surface as a model.

I am creating veterinary medical simulators which are then molded to create duplicates. It would be great to have a parametric function to create boxes/cubes with a draft on them to facilitate removal from the mold.
Thanks