Difference between revisions of "User:Inorton/Slicer4:Misc"

From NAMIC Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
*Does the signal/slot macro method allow for global tracking of active s&s?
 +
 
===Paths===
 
===Paths===
 
In Slicer3 the very useful "Slicer3SetupPaths" scripts are generated by a KWWidgets CMake macro script located here:
 
In Slicer3 the very useful "Slicer3SetupPaths" scripts are generated by a KWWidgets CMake macro script located here:
 
<pre>%/Slicer3-SuperBuild/KWWidgets/CMake/KWWidgetsPathsMacros.cmake</pre>
 
<pre>%/Slicer3-SuperBuild/KWWidgets/CMake/KWWidgetsPathsMacros.cmake</pre>
This is not available yet. Easy workaround:
+
This is not available yet. One possibility:
 
<pre>
 
<pre>
 
import os
 
import os
Line 10: Line 12:
 
for item in os.environ.keys():
 
for item in os.environ.keys():
 
         outfile.write(item + '=' + os.environ[item] + '\n')
 
         outfile.write(item + '=' + os.environ[item] + '\n')
outfile.flush()
 
 
outfile.close()
 
outfile.close()
 
</pre>
 
</pre>
Then just execfile from the Slicer python shell and source SetupSlicerPaths.sh.
+
Then just execfile this script from the Slicer python shell and then source SetupSlicerPaths.sh.. but this doesn't quite work because some paths are missing and there is a lot of extra stuff. Needs to be hand-edited to get all the right paths.
  
 
===Module/Plugin Notes===
 
===Module/Plugin Notes===
 
*http://www.na-mic.org/Wiki/index.php/Events:CTK-Hackfest-2010/SlicerQtPluginArchitecture
 
*http://www.na-mic.org/Wiki/index.php/Events:CTK-Hackfest-2010/SlicerQtPluginArchitecture
 
*http://stackoverflow.com/questions/43322/whats-safe-for-a-c-plug-in-system
 
*http://stackoverflow.com/questions/43322/whats-safe-for-a-c-plug-in-system
 +
 +
 +
===IPython===
 +
After sourcing the appropriate Slicer path-setup script:
 +
<pre>python setup.py install --root=/path/to/slicer</pre>
 +
Will set up ipython in the Slicer tree. To get readline and other system goodies I added a file called ZSyspaths.pth to Slicer/python-build/lib/python2.6/dist-packages with contents:
 +
<pre>
 +
/usr/lib/python2.6
 +
/usr/lib/python2.6/dist-packages/
 +
/usr/lib/python2.6/lib-dynload
 +
/usr/lib/pymodules/python2.6
 +
usr/lib/python2.6/lib-old
 +
/usr/lib/python2.6/plat-linux2
 +
</pre>

Latest revision as of 17:23, 10 November 2010

  • Does the signal/slot macro method allow for global tracking of active s&s?

Paths

In Slicer3 the very useful "Slicer3SetupPaths" scripts are generated by a KWWidgets CMake macro script located here:

%/Slicer3-SuperBuild/KWWidgets/CMake/KWWidgetsPathsMacros.cmake

This is not available yet. One possibility:

import os

outfn='SetupSlicerPaths.sh'
outfile = file(outfn,'w')
for item in os.environ.keys():
        outfile.write(item + '=' + os.environ[item] + '\n')
outfile.close()

Then just execfile this script from the Slicer python shell and then source SetupSlicerPaths.sh.. but this doesn't quite work because some paths are missing and there is a lot of extra stuff. Needs to be hand-edited to get all the right paths.

Module/Plugin Notes


IPython

After sourcing the appropriate Slicer path-setup script:

python setup.py install --root=/path/to/slicer

Will set up ipython in the Slicer tree. To get readline and other system goodies I added a file called ZSyspaths.pth to Slicer/python-build/lib/python2.6/dist-packages with contents:

/usr/lib/python2.6
/usr/lib/python2.6/dist-packages/
/usr/lib/python2.6/lib-dynload
/usr/lib/pymodules/python2.6
usr/lib/python2.6/lib-old
/usr/lib/python2.6/plat-linux2