Difference between revisions of "Summer2009:Using ITK in python"

From NAMIC Wiki
Jump to: navigation, search
m (Text replacement - "http://www.slicer.org/slicerWiki/index.php/" to "https://www.slicer.org/wiki/")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
<gallery>
 
<gallery>
Image:PW2009-v3.png|[[2009_Summer_Project_Week|Project Week Main Page]]
+
Image:PW2009-v3.png|[[2009_Summer_Project_Week#Projects|Project Week Main Page]]
 
Image:Itk75.png|ITK provides body of algorithms in C++
 
Image:Itk75.png|ITK provides body of algorithms in C++
 
Image:Python-logo.gif|Python provides interactive development environment.
 
Image:Python-logo.gif|Python provides interactive development environment.
Line 16: Line 16:
  
 
<h3>Objective</h3>
 
<h3>Objective</h3>
Develop strategies for embedding ITK filters in python code.
+
Develop strategies for embedding ITK filters in python code.  See if this would be a workable strategy for creating slicer modules.
  
 
</div>
 
</div>
Line 33: Line 33:
  
 
<h3>Progress</h3>
 
<h3>Progress</h3>
 
+
* Some pre-project week progress is shown [https://www.slicer.org/wiki/Slicer3:Python:pitky on this page in the slicer.org wiki]
 +
* Debugging of python internals with Demian and discussion of future directions.
 +
* Basic possibilities (all are somewhat convoluted):
 +
** WrapITK - combinatorial explosion; large libraries; C++ no longer available
 +
** Cython - yet another language; not clear how to use C++ idioms
 +
** Ctypeslib - good for teem.py, not good for C++
 +
** Weave - clear access to C++; can pass numpy arrays
 +
** Invoke CLI - clear distinction of C++ and python; easily supports multiple calling languages; CLIs are reusable executables/libraries; clear how to deploy; ITK IO requires one memcopy; approach is pretty indirect.
 +
* Confirmation that weave is a promising approach, but CLI still seems to be preferred approach.
  
 
</div>
 
</div>
 
</div>
 
</div>
  
 +
==References==
  
==References==
+
* http://www.slideshare.net/gsroma/integrando-c-com-python-presentation (in portugese)
 +
* http://www.scipy.org/Cookbook/Weave

Latest revision as of 17:39, 10 July 2017

Home < Summer2009:Using ITK in python


Key Investigators

  • GE: Jim Miller
  • Isomics: Steve Pieper
  • INRIA: Demian Wassermann

Objective

Develop strategies for embedding ITK filters in python code. See if this would be a workable strategy for creating slicer modules.

Approach, Plan

  • Look at how numpy arrays are passed to C/C++ code using techniques like cython, weave, etc.
  • Figure out what is needed to compile ITK code in these environments.
  • Compare and contrast this approach to WrapITK

Progress

  • Some pre-project week progress is shown on this page in the slicer.org wiki
  • Debugging of python internals with Demian and discussion of future directions.
  • Basic possibilities (all are somewhat convoluted):
    • WrapITK - combinatorial explosion; large libraries; C++ no longer available
    • Cython - yet another language; not clear how to use C++ idioms
    • Ctypeslib - good for teem.py, not good for C++
    • Weave - clear access to C++; can pass numpy arrays
    • Invoke CLI - clear distinction of C++ and python; easily supports multiple calling languages; CLIs are reusable executables/libraries; clear how to deploy; ITK IO requires one memcopy; approach is pretty indirect.
  • Confirmation that weave is a promising approach, but CLI still seems to be preferred approach.

References