SimpleITK/Design And Proposals/SIP 002
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.