<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I just finished creating an interface between numpy/slicer and my
ITK C++ project module using SWIG. I use pointers to avoid copying
and it works well. Happy to share what I have. <br>
<br>
- David<br>
<br>
<div class="moz-cite-prefix">On 02/04/2016 02:36 PM, Hyun Jae Kang
wrote:<br>
</div>
<blockquote
cite="mid:CAAsPJLowri4GCUDUnVUu858BVFMNYcsEhiuTxRvQz-9Otb4VHw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi all,</div>
<div><br>
</div>
<div><span
style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">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.</span><br>
</div>
<div><span
style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px"><br>
</span></div>
<div><span
style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">The
performance bottle can be removed by a</span><span
style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">llowing
SimpleITK’s image and the arrays of NumPy to share pointers
to the same memory symmetrically with copy-on-write
semantics. That is, </span><span
style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">reduce
data-copy operations in the data conversion. This approach
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.</span></div>
<div><br>
</div>
<div>For more detail information, please check the following
website:</div>
<div><a moz-do-not-send="true"
href="http://www.itk.org/Wiki/SimpleITK/Design_And_Proposals/SIP_002">http://www.itk.org/Wiki/SimpleITK/Design_And_Proposals/SIP_002</a> <br>
</div>
<div><br>
</div>
<div>Any your valuable comments are welcome.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Hyun Jae</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://kitware.com/products/protraining.php">http://kitware.com/products/protraining.php</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/insight-developers">http://public.kitware.com/mailman/listinfo/insight-developers</a>
</pre>
</blockquote>
<br>
</body>
</html>