<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 13, 2016 at 10:43 AM, Samuel St-Jean <span dir="ltr"><<a href="mailto:stjeansam@gmail.com" target="_blank">stjeansam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Regarding loading mat files, I was exactly doing that today, and it turns out anything that is matlab >= 2006b is using a file format without any converter currently existing.<br>
<br>
There are bug reports about that, but it still is a work in progress since a long time ago, so maybe not waiting on that for now is better to get stuff rolling.<br>
<br>
See <a href="https://savannah.gnu.org/bugs/?45706" rel="noreferrer" target="_blank">https://savannah.gnu.org/bugs/?45706</a> and while looking for it I alos found this <a href="http://octave.1599824.n4.nabble.com/Support-for-Matlab-s-7-3-file-format-td4676198.html" rel="noreferrer" target="_blank">http://octave.1599824.n4.nabble.com/Support-for-Matlab-s-7-3-file-format-td4676198.html</a></blockquote><div><br></div><div>Have you tried using h5py? I have had success with that, even for very recent versions of Matlab (2016a), and intricately nested structs. </div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div>
<br>
Le 2016-06-13 à 18:47, Matthew Brett a écrit :<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Hi,<br>
<br>
On Mon, Jun 13, 2016 at 7:56 AM, Marmaduke Woodman<br>
<<a href="mailto:marmaduke.woodman@univ-amu.fr" target="_blank">marmaduke.woodman@univ-amu.fr</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
hi all,<br>
<br>
I'm a dev behind the Virtual Brain (TVB) a neuroimaging simulation library,<br>
written in Python. As part of an effort to reach out to some users stuck in<br>
MATLAB, I've been testing MATLAB's recent *official* support for Python<br>
(2014b+). It is notably better than the many other attempts because it<br>
appears to use Py's C API to expose objects and methods as MATLAB objects<br>
and methods instead of just providing eval/exec.<br></blockquote></blockquote></div></div></blockquote><div><br></div><div>Yes - as a co-author of an eval/exec solution (<a href="http://arokem.github.io/python-matlab-bridge/" target="_blank">http://arokem.github.io/python-matlab-bridge/</a>), I am happy to see that they are doing the work to provide a more thorough solution. I wish that they told us what they are doing (rather than providing an opaque executable). These kinds of solutions can be reconfigured into many other useful things (think 0MQ). But hey - it's a start! To be fair, there was an attempt at an open-source project in this direction (I believe this one: <a href="http://mlabwrap.sourceforge.net/">http://mlabwrap.sourceforge.net/</a>), but of course it's better if Mathworks provide the authoritative solution.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Generally it's working, but there are some workarounds to avoid segfaults,<br>
errors and lack of stdout/err. I've started to collect a series of tips and<br>
workarounds and figured there might be common interest in the community for<br>
a "helper" library so all our projects can benefit from a larger user base,<br>
and maybe ease the transition for potential Python users.<br>
<br>
The most important in order,<br>
<br>
- Anything touching HDF5 must use exactly the same version as MATLAB or<br>
segfault<br>
</blockquote>
Ouch - I guess this means it's not possible to use h5py or pytables?<br></blockquote></div></div></blockquote><div><br></div><div>So - yes - the answer here seems to be "yes" (see above). </div><div><br></div><div>Marmaduke - what exactly do you mean "anything touching HDF5"? What series of steps causes this segfault? </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- Scipy.io.{save,load}mat segfault<br>
</blockquote>
That's interesting - it's probably possible to fix that, because that<br>
stuff doesn't call any external libraries. Do you have any more<br>
details?<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- C++ extension modules whose exception model doesn't match MATLAB's,<br>
segfault on exception<br>
- Linalg segfault unless using MKL (which is what MATLAB uses)<br>
- stdout/err and logging must be redirecting to mexPrintf via a ctypes<br>
monkey patch<br>
- Numpy/MATLAB array conversion is O(1) op, but can probably be made zero<br>
copy with a ctypes + lib mx workaround<br>
<br>
Aside from these (for which I sent a service request to MathWorks), it's<br>
working well and we (TVB) expect our next release to include demo scripts in<br>
MATLAB.<br>
<br>
So, again, if there is common interest in collecting notes and a helper<br>
library to monkey patch around the segfaults, it'd be great to not do this<br>
alone ;)<br>
</blockquote>
Thanks too for the feedback. You might also get some interest over<br>
at the numpy / scipy lists. Although the blas / lapack thing is a bit<br>
of a downer...<br>
<br>
Cheers,<br>
<br>
Matthew<br>
_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/neuroimaging</a><br>
</blockquote>
<br>
_______________________________________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/neuroimaging</a><br>
</div></div></blockquote></div><br></div></div>