Hi Tom,<div><br></div><div>I have no time to wait, so the second option is not really an option, but your code is interesting, I hope it will be useful to me. Actually the logarithms I want to calculate belong to different affine transformation matrices, so they are probably not symmetric.</div>
<div>So I will look into your implementation. Thanks! <br><br><div class="gmail_quote">On Mon, Jun 28, 2010 at 10:56 PM, Tom Vercauteren <span dir="ltr"><<a href="mailto:tom.vercauteren@m4x.org">tom.vercauteren@m4x.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Zoltan,<br>
<br>
As far as I know, getting the (generic) matrix logarithm in c++ (as<br>
opposed to python or matlab) is a pain...<br>
<br>
Last time I needed it, I wasn't able to find it. Hence, I made my own<br>
(vnl based) from a previous version of people at Asclepios lab. You<br>
will find this implementation in an Insight Journal submission of mine<br>
(look in vnl_sd_matrix_tools.h):<br>
<a href="http://hdl.handle.net/10380/3060" target="_blank">http://hdl.handle.net/10380/3060</a><br>
<br>
I am definitely not a linear algebra expert and the code is nothing to<br>
be proud of. Writing good linear algebra is quite challenging. If you<br>
wait long enough, it could well be that a decent logm will appear in<br>
eigen:<br>
<a href="http://bytebucket.org/eigen/eigen/issue/38/feature-request-more-matrix-functions-eg-matrix" target="_blank">http://bytebucket.org/eigen/eigen/issue/38/feature-request-more-matrix-functions-eg-matrix</a><br>
<br>
That being said, if you know that your matrices are diagonalisable<br>
(e.g. symmetric matrices), the problem becomes of course much simpler.<br>
<br>
Anyhow, if the logm implementation in vnl_sd_matrix_tools suits your<br>
need or if you enhance it, be it just by adding more code coverage,<br>
let me know.<br>
<br>
Hope this helps,<br>
<font color="#888888">Tom<br>
</font><div><div></div><div class="h5"><br>
On Mon, Jun 28, 2010 at 14:00, Zoltan Seress <<a href="mailto:seress.zoltan@gmail.com">seress.zoltan@gmail.com</a>> wrote:<br>
> Hi all,<br>
> Is there a way to get the logarithm (principal) of a matrix with ITK? I<br>
> haven't found any, but it doesn't mean that there isn't.<br>
> Thanks!<br>
><br>
> --<br>
> Zoli<br>
><br>
</div></div><div><div></div><div class="h5">> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" 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" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Zoli<br>
</div>