View Issue Details

IDProjectCategoryView StatusLast Update
0004707Slicer4Module Markupspublic2019-08-21 10:25
Reporterarankin Assigned Toarankin  
PriorityurgentSeveritycrashReproducibilityalways
Status closedResolutionnot fixable 
Platformamd64OSWindowsOS Version10 Creators
Product VersionSlicer 4.11.0 
Target VersionFixed in Version 
Summary0004707: Slicer crashes when observing calldata on vtkMRMLMarkupsNode.PointModifiedEvent
Description

When using python observer with calldata decorator, vtkMRMLMarkupsNode.PointModifiedEvent causes a crash.

Steps To Reproduce

Start Slicer
Place fiducial
Run code:

f = getNode('F')
@vtk.calldata_type(vtk.VTK_OBJECT)
def hi(caller, eventId, callData):
print("hi")
f.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, hi)

then move the fiducial in one of the views

Additional Information

Python 3.6.7 (default, Jul 29 2019, 23:26:11) [MSC v.1900 64 bit (AMD64)] on win32

f = getNode('F')
f
(vtkSlicerMarkupsModuleMRMLPython.vtkMRMLMarkupsFiducialNode)000001E020E05708
@vtk.calldata_type(vtk.VTK_OBJECT)
... def hi(caller, eventId, callData):
... print("hi")
...
f.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, hi)
70

TagsNo tags attached.

Activities

johan.andruejol

johan.andruejol

2019-08-20 15:50

manager   ~0016280

I've had this issue before, it's very puzzling. The correct decorator is actually with @vtk.calldata_type(vtk.VTK_INT)

The following code works for me:
Python 3.6.7 (default, Jun 13 2019, 15:47:35) [MSC v.1900 64 bit (AMD64)] on win32
f = getNode('F')
@vtk.calldata_type(vtk.VTK_INT)
def hi(caller, eventId, callData):
print("hi")

f.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, hi)

arankin

arankin

2019-08-21 10:25

developer   ~0016282

I just thought of this last night while falling asleep! I had decorated it incorrectly. Thanks!

arankin

arankin

2019-08-21 10:25

developer   ~0016283

Reporter error, incorrect decorator on python function.

Issue History

Date Modified Username Field Change
2019-08-20 14:58 arankin New Issue
2019-08-20 14:58 arankin Status new => assigned
2019-08-20 14:58 arankin Assigned To => nicole
2019-08-20 15:50 johan.andruejol Note Added: 0016280
2019-08-21 10:25 arankin Note Added: 0016282
2019-08-21 10:25 arankin Assigned To nicole => arankin
2019-08-21 10:25 arankin Status assigned => closed
2019-08-21 10:25 arankin Resolution open => not fixable
2019-08-21 10:25 arankin Note Added: 0016283