<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Guillaume,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">we have switched to <a href="https://discourse.itk.org/">discourse</a> forum for discussion. Can you repost your question there?</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 25, 2018 at 10:26 AM, Guillaume Lemaître <span dir="ltr"><<a href="mailto:g.lemaitre58@gmail.com" target="_blank">g.lemaitre58@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi All,<br><br></div>I am using the python wrapper of itk to manipulate. I checked the quick start guide (<a href="http://itkpythonpackage.readthedocs.io/en/latest/Quick_start_guide.html#usage" target="_blank">http://itkpythonpackage.<wbr>readthedocs.io/en/latest/<wbr>Quick_start_guide.html#usage</a>) to go from numpy to vnl matrices and vice-versa. However, I got into trouble when trying to use those utils with itk images. As a short example:<br><br></div>```python<br></div>>>> import numpy as np<br><br>>>> img = np.random.random((100, 100, 100))<br>>>> img_itk = itk.GetImageFromArray(img)<br><br></div>>>> vnl_matrix = img_itk.GetDirection().<wbr>GetVnlMatrix()<br>>>> type(vnl_matrix)<br>vnl_matrix_fixedPython.vnl_<wbr>matrix_fixedD_3_3<br><br></div>>>> itk.GetArrayFromVnlMatrix(vnl_<wbr>matrix)<br><br>TypeError: in method 'itkPyVnlD__<wbr>GetArrayViewFromVnlMatrix', argument 1 of type 'vnl_matrixD *'<br><div><div><div>```<br><br></div><div>So what would the proper way of converting this matrix into a numpy array or view.<br><br></div><div>Cheers,<span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_-7429705383238222666gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Guillaume Lemaitre<br>INRIA Saclay - Parietal team<br>Center for Data Science Paris-Saclay<br><a href="https://glemaitre.github.io/" target="_blank">https://glemaitre.github.io/</a></div></div></div></div></div></div></div>
</font></span></div></div></div></div>
<br>The ITK community is transitioning from this mailing list to <a href="http://discourse.itk.org" rel="noreferrer" target="_blank">discourse.itk.org</a>. Please join us there!<br>
______________________________<wbr>__<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://itk.org/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">https://itk.org/mailman/<wbr>listinfo/insight-users</a><br>
<br></blockquote></div><br></div>