View Issue Details

IDProjectCategoryView StatusLast Update
0003178Slicer4Core: Scripting (Wrapping, Python)public2013-06-19 21:53
Reporterluis Assigned Tojcfr  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.0 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003178: Useful methods of qMRMLTransformSliders not exposed to Python
Description

I wanted to use the qMRMLTransformSliders widget to specify local orientation in a scriptable module. However, the two methods I need to do this are not exposed to Python. These methods are:

setCoordinateReference()
setTypeOfTransform()

There are many other unexposed methods in the widget that would also be very useful like setTitle() and setRange(). On my fork I simply added the Q_INVOKABLE macro to the declarations of each of these methods and I got the functionality I needed, but I wasn't sure whether there is a better way to handle this.

TagsSummer AHM 2013

Activities

jcfr

jcfr

2013-06-19 21:53

administrator   ~0008793

These methods are already made available with the help of Q_PROPERTY and can be set/read using the name of the associated property. For example:

w = slicer.qMRMLTransformSliders()
w.CoordinateReference = w.GLOBAL
w.TypeOfTransform = w.ROTATION

Consider also looking at the associated doxygen page:
http://slicer.org/doc/html/classqMRMLTransformSliders.html

or the source: https://github.com/Slicer/Slicer/blob/8184c4f882206be42a0e4aa0c931794951cd2bc0/Libs/MRML/Widgets/qMRMLTransformSliders.h#L43-55

Issue History

Date Modified Username Field Change
2013-06-19 06:18 luis New Issue
2013-06-19 06:18 luis Status new => assigned
2013-06-19 06:18 luis Assigned To => jcfr
2013-06-19 21:44 jcfr Target Version => Slicer 4.3.0
2013-06-19 21:53 jcfr Note Added: 0008793
2013-06-19 21:53 jcfr Status assigned => closed
2013-06-19 21:53 jcfr Resolution open => fixed
2013-06-19 21:53 jcfr Fixed in Version => Slicer 4.3.0
2013-06-19 21:53 jcfr Tag Attached: Summer AHM 2013