SimpleITK/Design And Proposals/SIP 002: Difference between revisions
Hyunjae.kang (talk | contribs) |
Hyunjae.kang (talk | contribs) |
||
Line 18: | Line 18: | ||
In terms of technical approach, this work will include implementing the buffer interface [https://docs.python.org/2/c-api/buffer.html ] and improving the ITK ImportImageContainer [http://www.itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html ] for sharing a data pointer between SimpleITK’s image data and the N-dimensional array object of NumPy. | In terms of technical approach, this work will include implementing the buffer interface [https://docs.python.org/2/c-api/buffer.html ] and improving the ITK ImportImageContainer [http://www.itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html ] for sharing a data pointer between SimpleITK’s image data and the N-dimensional array object of NumPy. | ||
The improved data handling methods in SimpleITK will expose an image data of SimpleITK with the buffer interface [https://docs.python.org/2/c-api/buffer.html]. This method of data handling will utilized the buffer and memoryview constructs in CPython 2 [https://docs.python.org/2/c-api/buffer.html ] and the buffer protocol in CPython 3 [https://docs.python.org/3/c-api/buffer.html ]. | |||
==== Comments ==== | ==== Comments ==== |
Revision as of 17:40, 4 February 2016
SIP 002 - Data Bridge for SimpleITK
Introduction
SimpleITK is an emerging useful tool for image analysis, segmentation and registration by providing a simplified interface to ITK in variety of programming language. However, many users implement and develop their image processing methods with the N-dimensional array object and functions of the Numpy package in parallel.
To support data transparency between the functions of SimpleITK and NumPy, SimpleITK provides functional integration with NumPy-based script and a method of data-conversion between SimpleITK’s image data and the N-dimensional array object of NumPy. But, there is a significant performance bottleneck in the data-conversion which is based on the operation of data copy. The performance bottleneck can be increased with the size of handling image data and the number of data-conversion.
We wish to remove the performance bottleneck by allowing SimpleITK’s image and the arrays of NumPy to share pointers to the same memory symmetrically with copy-on-write semantics. In addition, we wish these enhancements will deliver the performance improvements to many existing SimpleITK’s scripts through a simple library update.
Comments
Brad Lowekamp: Comments can be made here
Reduce data-copy operations in the data conversion
Reduction data-copy operation in the data conversion can be accomplished by developing and/or improving existing data handling methods in ITK and SimpleITK to enable copy-on-write sharing of data between SimpleITK’s image data and other common data object of Python libraries used. for scientific computing and image processing. NumPy is our primarily considered library because the N-dimensional data array of the NumPy package can be integrated with and expanded to other libraries such as Pandas and libdynd.
In terms of technical approach, this work will include implementing the buffer interface [1] and improving the ITK ImportImageContainer [2] for sharing a data pointer between SimpleITK’s image data and the N-dimensional array object of NumPy.
The improved data handling methods in SimpleITK will expose an image data of SimpleITK with the buffer interface [3]. This method of data handling will utilized the buffer and memoryview constructs in CPython 2 [4] and the buffer protocol in CPython 3 [5].