View Issue Details

IDProjectCategoryView StatusLast Update
0002151Slicer4Core: Documentation and Wikipublic2013-07-02 15:10
Reporterclisle Assigned Topieper  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0002151: Document python scripting API
Description

Slicer Developers,
I am developing a Python scripted module in Slicer 4. It would enhance my debugging ability to access the module itself and/or functions defined in the module from the Slicer Python interpreter. Is this possible? Is there a reference to better understand how Slicer modules, particular scripted modules, are wrapped in Python? Thanks.

Curt

TagsNo tags attached.

Activities

jcfr

jcfr

2012-06-01 08:50

administrator   ~0004733

From Steve Pieper - June 1st, 2012:

Hi Curt -

There's some information here from the January meeting:

http://www.na-mic.org/Wiki/index.php/AHM2012-Slicer-Python

What I tend to do is create an entry in my ~/.slicerrc.py file that sets up a hot key to reload the module and create a new instance of it. I set a global python variable for the new instance and that lets me easily access the module gui and logic using the console (i.e. tab complete for methods and properties, setting values, calling methods...). This also lets you modify the source code and test it in slicer without having to restart.

-Steve

pieper

pieper

2013-07-02 10:39

administrator   ~0008814

Hi Curt -

Could you have a look at this documentation and see if it has the elements you need?

http://www.na-mic.org/Wiki/index.php/2013_Project_Week_Breakout_Session:Slicer4Python

-Steve

Issue History

Date Modified Username Field Change
2012-06-01 08:49 jcfr New Issue
2012-06-01 08:49 jcfr Reporter jcfr => clisle
2012-06-01 08:49 jcfr Target Version => Slicer 4.2.0 - Sept 1st 2012
2012-06-01 08:50 jcfr Note Added: 0004733
2012-07-31 12:30 pieper Assigned To => pieper
2012-07-31 12:30 pieper Status new => acknowledged
2012-08-20 12:25 jcfr Target Version Slicer 4.2.0 - Feature freeze Sept 1st 2012 => Slicer 4.2.5
2012-08-21 09:40 jcfr Target Version Slicer 4.2.5 => Slicer 4.3.0
2013-07-02 10:39 pieper Note Added: 0008814
2013-07-02 10:39 pieper Status acknowledged => feedback
2013-07-02 13:41 clisle Status feedback => resolved
2013-07-02 15:10 pieper Status resolved => closed
2013-07-02 15:10 pieper Resolution open => fixed
2013-07-02 15:10 pieper Fixed in Version => Slicer 4.3.0
2016-06-20 14:15 jcfr Category Core: Documentation & Wiki => Core: Documentation and Wiki