<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Matrices and images are row major order. Points and vectors are column vectors. </div><div><br></div><div>No transpose is necessary. You can index element by element directly to set the column you want. </div><div><br></div><div>Row major ordering is more popular than column major ordering. I think there are regional preferences as to the"proper" way. I also think electrical engineers prefer one way whereas mechanical engineers prefer the other. Probably is partially based on how disciplines view the composition of coordinate frames (inside out or outside in). </div><div><br></div><div>Some systems allow you to use either convention. We found that leads to a lot of confusion and errors. So 15 years ago, when we started ITK, we chose to pick a single standard for the code. <br><br>Jim</div><div><br>On Aug 22, 2014, at 9:49 PM, vincent ngai <<a href="mailto:vincent.ngai@gmail.com">vincent.ngai@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Ah yes, so my question is why is the [] accessor not column major? If points are columns, the matrix elements for the Tx,Ty,Tz translation components should also be columnar? It just seems like extra work to need to get the matrix transpose just to do a Mat * P<div>
<br></div><div>Regards,</div><div>Vincent</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 7:14 PM, Jim Miller <span dir="ltr"><<a href="mailto:millerjv@gmail.com" target="_blank">millerjv@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ITK standard is that points are column vectors. Thus, matrix times a point a point is defined as Mat * P<br>
<br>
Jim<br>
<div><div class="h5"><br>
> On Aug 22, 2014, at 3:30 AM, vincent ngai <<a href="mailto:vincent.ngai@gmail.com">vincent.ngai@gmail.com</a>> wrote:<br>
><br>
> Hi all, pardon me for this silly question on itk::Matrix. Why do I need to transpose a translation matrix after I copy the [x,y,z] translation values to the matrix[3].<br>
><br>
> I know conceptually it should not really matter whether its row or col major so long as you can<br>
> post multiply or pre multiply with another vector. But the way operator*() works only allows for<br>
> Matrix * P, and when I test the simple case of TranslationMatrix * Point, I would have to transpose the matrix. If I could also do Point * TranslationMatrix, then i wouldn't need to transpose.<br>
><br>
> Any ideas?<br>
><br>
> --<br>
> Regards,<br>
> Vincent<br>
</div></div>> _____________________________________<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.php" target="_blank">http://www.kitware.com/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" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Vincent<br>
</div>
</div></blockquote></body></html>