mailRe: Bug in structure.create diff tensor pdb


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on March 12, 2009 - 20:29:
Note, the typo is not in equations 8.197a-c on page 319, only in the
first equation of the rotation matrix elements.

Regards,

Edward


On Thu, Mar 12, 2009 at 8:23 PM, Edward d'Auvergne
<edward.dauvergne@xxxxxxxxx> wrote:
On Thu, Mar 12, 2009 at 7:04 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:
Edward d'Auvergne wrote:
On Thu, Mar 12, 2009 at 6:05 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:

Hi,

In an attempt to find the problem causing this bug, I dug into the code
and found something which could be erroneous... This alone does not fix
the bug, but may be part of the fix (or not)...

In function math_fns/direction_cosine.calc_ellipsoid_di(), there could
be an error at line 229:

   diff_data.dz[1] =  data.sin_b * data.sin_g

If I am right (?), this part of the code is related to page 193 of
Edward  d'Auvergne's thesis:

   c11  =  diff_data.dx[0]
   c21  =  diff_data.dx[1]
   c31  =  diff_data.dx[2]

   c12  =  diff_data.dy[0]
   c22  =  diff_data.dy[1]
   c32  =  diff_data.dy[2]

   c13  =  diff_data.dz[0]
   c23  =  diff_data.dz[1]  -->  FALSE !!!!
   c33  =  diff_data.dz[2]

Indeed,
   c23 = sin(beta) * cos(gamma),
whereas
   diff_data.dz[1] =  data.sin_b * data.sin_g


Thus, either me, the code or Edward's thesis are erroneous here...

Am I right ?


These unit vectors are the columns of the reverse matrix, or the
transpose, or simply rows of the normal matrix.  This depends if you
are defining the rotation from being from the diffusion tensor frame
to the lab frame or the reverse - both are related by the transpose.
Hence this value is c32 which in my thesis is sin(alpha)*sin(beta).
Does this answer your question and solve the issue?  There could be
bugs elsewhere in here though because of this.


Ok... I am far from an expert in trigonometry...  :p

If I understand well what you wrote, there is no error in the code or
the thesis ? Or should something be corrected ?

Sorry, I had a much closer look and you are correct - there is an
error there.  The problem is a typo in equation 6.61 (page 193) of my
thesis, c23 should be sin(beta) * sin(gamma).  I double checked using
wikipedia and tracked it back to the thesis.  Glad that it's in the
thesis and not the code!!!

Cheers,

Edward


P.S.  It would be useful if you could confirm that the problem is
indeed in the thesis and not the code ;)




Related Messages


Powered by MHonArc, Updated Fri Mar 13 15:40:44 2009