View Issue Details

IDProjectCategoryView StatusLast Update
0004181Slicer4Core: Scripting (Wrapping, Python)public2018-03-02 11:07
Reportercriskross Assigned Tohastings.greer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in VersionSlicer 4.6.0 
Summary0004181: Python Scripting: InvokeEvent needs to support integer (and other call data types)
Description

I tried to invoke an Event and I was wondering why i cannot pass any integer arguments as calldata

as in vtk/util/misc.py described:

supported_call_data_types = ['string0', vtk.VTK_STRING, vtk.VTK_OBJECT, vtk.VTK_INT, vtk.VTK_LONG, vtk.VTK_DOUBLE, vtk.VTK_FLOAT]

So would expect to also be able to invoke events with such data.

Steps To Reproduce

paramNode = slicer.vtkMRMLScriptedModuleNode()
paramNode.InvokeEvent(vtk.vtkCommand.ModifiedEvent, 4)

Additional Information

TypeError: arguments do not match any overloaded methods

TagsNo tags attached.

Activities

jcfr

jcfr

2016-06-08 23:39

administrator   ~0013955

Last edited: 2016-06-08 23:55

View 2 revisions

Corresponding feature has now been integrated in upstream VTK.

See https://gitlab.kitware.com/vtk/vtk/merge_requests/1543#note_113804
and https://github.com/Kitware/VTK/commit/b16a311a3d1f1e59ce3756df4114f80d7a3a2dc4

It will be available in Slicer either after updating Slicer/VTK (either by cherry-picking the change or creating a new branch based on VTK master).

jcfr

jcfr

2016-06-09 14:53

administrator   ~0013967

Fixed in r25177
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25177

criskross

criskross

2017-03-13 15:33

developer   ~0014373

Last edited: 2017-03-13 15:34

View 2 revisions

I just noticed that invoking an event with VTK_INT value 0, Slicer crashes.

Related Changesets

Import 2017-06-07 23:51:09: master acc9915c

2016-06-09 14:50:18

jcfr

Details Diff
BUG: Update VTK: Support InvokeEvent with param from python. Fixes 0004181

Currently it only supports strings, floats and ints.

Infrastructure to support vtkObjects is also in place, but cherry-picking
the wrapping infrastructure patches to support it are too involved
to be reliably done.

Doing the following is now expected to work:

paramNode = slicer.vtkMRMLScriptedModuleNode()
paramNode.InvokeEvent(vtk.vtkCommand.ModifiedEvent, 4)

$ git shortlog 4b9957b..f08b7db --no-merges
Hastings Greer (1):
Allow pyvtkObjects to have InvokeEvent called on them with calldata


Thanks: Hastings Greer <hastings.greer@kitware.com>
Thanks: David Gobbi <david.gobbi@gmail.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25177 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild/External_VTKv6.cmake Diff File

Issue History

Date Modified Username Field Change
2016-04-28 17:13 criskross New Issue
2016-04-28 17:13 criskross Status new => assigned
2016-04-28 17:13 criskross Assigned To => alexy
2016-06-08 23:39 jcfr Note Added: 0013955
2016-06-08 23:55 jcfr Note Edited: 0013955 View Revisions
2016-06-08 23:55 jcfr Assigned To alexy => hastings.greer
2016-06-08 23:55 jcfr Category Core: MRML => Core: Scripting (Wrapping, Python)
2016-06-09 14:53 jcfr Note Added: 0013967
2016-06-09 14:53 jcfr Status assigned => resolved
2016-06-09 14:53 jcfr Fixed in Version => Slicer 4.6.0
2016-06-09 14:53 jcfr Resolution open => fixed
2017-03-13 15:33 criskross Note Added: 0014373
2017-03-13 15:34 criskross Note Edited: 0014373 View Revisions
2017-06-10 08:51 jcfr Changeset attached => Slicer master acc9915c
2018-03-02 11:07 jcfr Status resolved => closed