Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slicer 5.1.0 crash when setting the control points for vtkMRMLLiverResectionNode using SetBezierSurfaceControlPoints(vtkPoints* controlPoints) #193

Open
dalbenzioG opened this issue Jan 20, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dalbenzioG
Copy link
Collaborator

dalbenzioG commented Jan 20, 2023

Slicer exits abnormally when SetBezierSurfaceControlPoints is called here:

ResectionNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLLiverResectionNode")
ResectionNode.SetBezierSurfaceControlPoints(points) # points are  16 control points (vtkPoints)

After debugging, the unexpected behavior is caused here:

bool vtkMRMLLiverResectionNode::SetBezierSurfaceControlPoints(vtkPoints* controlPoints)

As stated here, "Review the need for this. We already have a pointer to the surface node".

Using the following lines of code for setting my ResectionNode does not cause any crash

# points are the control points represented as vtkPoints
pointPlaceMode = slicer.vtkMRMLMarkupsDisplayNode.SnapModeUnconstrained
BezierNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsBezierSurfaceNode")
BezierNode.SetControlPointPositionsWorld(points)
BezierNode.GetDisplayNode().SetSnapMode(pointPlaceMode)
ResectionNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLLiverResectionNode")
ResectionNode.SetTargetOrganModelNode(liverNode)
b = ResectionNode.GetBezierSurfaceNode()
b.RemoveAllControlPoints()
b.SetControlPointPositionsWorld(points)

@dalbenzioG dalbenzioG added the bug Something isn't working label Jan 20, 2023
@RafaelPalomar
Copy link
Collaborator

RafaelPalomar commented Jan 23, 2023 via email

@RafaelPalomar RafaelPalomar self-assigned this Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants