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">&lt;<a href="mailto:tom.vercauteren@m4x.org">tom.vercauteren@m4x.org</a>&gt;</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&#39;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 &lt;<a href="mailto:seress.zoltan@gmail.com">seress.zoltan@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt; Is there a way to get the logarithm (principal) of a matrix with ITK? I<br>
&gt; haven&#39;t found any, but it doesn&#39;t mean that there isn&#39;t.<br>
&gt; Thanks!<br>
&gt;<br>
&gt; --<br>
&gt; Zoli<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Zoli<br>
</div>