<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
DIV.FoxDiv20130408112211072237 {
        COLOR: #000000
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 微软雅黑; COLOR: #000080; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16455"></HEAD>
<BODY style="MARGIN: 10px">
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000">Dear Dr
<FONT style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000">J-Donald Tournier,</SPAN></FONT></SPAN></DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000"> </SPAN></FONT></SPAN></DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000">Thank you for your help. And I have another question. I
have a dataset from GE scanner. I get one of the gradient directions is '-0.002,
1.000, 0.000' with the command 'dicominfo' in Matlab. The gradient direction
achieved with the command 'mrinfo' in Mrtrix is '-0.00650699, -0.998944,
-0.0454892 ', and the transform matrix achieved with 'mrinfo ' is [0.9951
0.004517 0.09862 -136.6; -0 0.9989 -0.04591 -104.6; -0.09873 0.04569 0.9941
-50.04; 0 0 0 1]. Can I transform the direction '-0.002, 1.000, 0.000' to
'-0.00650699, -0.998944, -0.0454892 ' with the transform matrix. No matter
flipping the sign of z component or not, I cannot get '-0.00650699, -0.998944,
-0.0454892 ' from '-0.002, 1.000, 0.000'. Are there other steps for
the transfromation to get '-0.00650699, -0.998944, -0.0454892 '
.</SPAN></FONT></SPAN></DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000"></SPAN></FONT></SPAN> </DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000">
<DIV><FONT size=3 face="Times New Roman">Thanks.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3 face="Times New Roman"></FONT></DIV>
<DIV><FONT size=3 face="Times New Roman">Regards,</FONT></DIV>
<DIV><FONT size=3 face="Times New Roman">Sangma Xie</FONT></DIV>
<DIV></DIV></SPAN></FONT></SPAN></DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000"> </SPAN></FONT></SPAN><SPAN
style="COLOR: #000000"><FONT style="FONT-FAMILY: Times New Roman" size=3
face=""><SPAN style="COLOR: #000000"></SPAN></FONT></SPAN></DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000"></SPAN></FONT></SPAN> </DIV>
<DIV style="FONT-FAMILY: Times New Roman"><SPAN style="COLOR: #000000"><FONT
style="FONT-FAMILY: Times New Roman" size=3 face=""><SPAN
style="COLOR: #000000"> </SPAN></SPAN></FONT></DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>
<DIV><SPAN style="FONT-FAMILY: 宋体; COLOR: #000000; FONT-SIZE: 10.5pt"><SPAN
style="FONT-FAMILY: Times New Roman"><SPAN style="FONT-SIZE: 10.5pt"><SPAN
style="FONT-SIZE: 10.5pt">Sangma Xie , Master </SPAN> </SPAN>
<DIV><SPAN style="FONT-FAMILY: Times New Roman">Brainnetome Center
<DIV style="FONT-FAMILY: Times New Roman">National Laboratory of Pattern
Recognition (NLPR)</DIV>Institute of Automation, Chinese Academy of Sciences
(CASIA)<BR>95 Zhong Guan Cun East Road, Hai Dian District, Beijing 100190,
P.R.China</SPAN></SPAN><BR><BR></DIV></SPAN></DIV></SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:d.tournier@brain.org.au">Donald
Tournier</A></DIV>
<DIV><B>Date:</B> 2013-04-03 11:26</DIV>
<DIV><B>To:</B> <A href="mailto:smxie@nlpr.ia.ac.cn">smxie</A></DIV>
<DIV><B>CC:</B> <A
href="mailto:mrtrix-discussion@www.nitrc.org">mrtrix-discussion</A></DIV>
<DIV><B>Subject:</B> Re: [Mrtrix-discussion] Question about the gradient
direction table used in Mrtrix</DIV></DIV></DIV>
<DIV>
<DIV class=FoxDiv20130408112211072237>
<DIV>Hi Sangma,<BR><BR>OK, there's quite a few issues at play here. First off,
the convention used in MRtrix is that the gradients are specified with respect
to the DICOM patient coordinate system. This is essentially the same convention
as for DICOM images produced on Siemens and Philips scanners, and the newer
standard DICOM tags recently introduced, with one notable exception: the DICOM
patient-centered coordinate system has its x-axis running right-to-left and its
y-axis running anterior-posterior, whereas MRtrix assumes these axes run in the
opposite direction (as per the NIfTI standard). So MRtrix will flip the x &
y components to account for this. </DIV>
<DIV><BR></DIV>
<DIV>For Siemens & Philips images, that's essentially all that happens to
the DW gradients. For GE images, it's a little different, since in this case the
gradients are (or at least, used to be) stored with respect to the images axes.
This means that to convert to MRtrix convention, they must be re-oriented back
into the patient-centered coordinate system. This is what the rotate_DW_scheme
flag specifies: when the DW gradient information was read from a GE-specific
tag, this is set to true and the gradients are then rotated according to the
direction of the images axes. In this case, the z component is inverted, since
flipping the x & y is essentially the same as flipping z, given the symmetry
of diffusion.</DIV>
<DIV><BR>As far as I know, dcm2nii provides the DW directions with respect to
the image axes (in the NIfTI coordinate system). To convert these back to MRtrix
convention, the same transformation as you highlighted is needed, but
<I>without</I> the negative sign. The transform you highlighted also accounts
for differences in the directions of these axes due to the different conventions
used for DICOM versus NifTI/MRtrix, so is not appropriate as-is to do convert a
dcm2nii-supplied gradient table into one suitable for MRtrix. This is
because the dcm2nii gradient table is provided with respect to the image axes in
NIfTI coordinate space, and in MRtrix they are provided with respect to the
original axes, also in NIfTI coordinate space. <BR><BR>To get back to your
question, what do you mean when you say 'the original gradient table'? The one
supplied by dcm2nii (in which case converting using the highlighted section of
code would not work, as explained above), or the actual ones as read directly
from the DICOM headers? If the latter, then unless your images were acquired on
a GE scanner, then that also would not work, since that section of code would
only be used for GE images. If you are trying to convert non-GE DW directions
read directly from the DICOM headers, then all you need to do is flip the sign
of the x & y components. </DIV>
<DIV><BR></DIV>
<DIV>Basically, it's really hard to keep track of all the possible conventions
and what each step in the processing pipeline might have done to the DW
gradients. Hopefully the above will help you figure out where the problem might
be...</DIV>
<DIV><BR></DIV>
<DIV>Hope this helps.</DIV>
<DIV>Cheers,</DIV>
<DIV><BR></DIV>
<DIV>Donald.</DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV class=gmail_quote>On 3 April 2013 12:57, smxie_nlpr <SPAN dir=ltr><<A
href="mailto:smxie@nlpr.ia.ac.cn"
target=_blank>smxie@nlpr.ia.ac.cn</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV style="MARGIN: 10px">
<DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">Hi,</SPAN></DIV>
<DIV class=im>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px"></SPAN> </DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">I
have a question about the gradient direction table used in Mrtrix. The
gradient direction table achieved from the DICOM images with dcm2nii is
different from the table achieved with the command 'mrinfo DICOMDIR -grad
encoding.b'. I checked the source code of Mrtrix and found the following codes
'</SPAN></DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px"></SPAN><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">if(rotate_DW_scheme)</SPAN></DIV>
<DIV
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; FONT: medium Tahoma; WHITE-SPACE: normal; WORD-SPACING: 0px">
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">{</DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">G(n,0) =
image_transform(0,0) * d[0] + image_transform(0,1) * d[1] -
image_transform(0,2) * d[2];</DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">G(n,1) =
image_transform(1,0) * d[0] + image_transform(1,1) * d[1] -
image_transform(1,2) * d[2];</DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">G(n,2) =
image_transform(2,0) * d[0] + image_transform(2,1) * d[1] -
image_transform(2,2) * d[2];</DIV></DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">}</SPAN><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">'
in image.cpp.</SPAN></DIV>
<DIV><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">I
transformed the original gradient table with similar code in Matlab, but the
result is not equal to the table achieved with mrinfo. So I want to know the
procedure of transforming the original gradients to the gradients achieved
with mrinfo. And why is it '</SPAN><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">G(n,0)
= image_transform(0,0) * d[0] + image_transform(0,1) * d[1] -
image_transform(0,2) * d[2];</SPAN><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: 12pt Times New Roman; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px">'
rather than '</SPAN><SPAN
style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; LETTER-SPACING: normal; DISPLAY: inline !important; FONT: medium Tahoma; WHITE-SPACE: normal; FLOAT: none; WORD-SPACING: 0px"><SPAN
style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">G(n,0) =
image_transform(0,0) * d[0] + image_transform(0,1) * d[1] +
image_transform(0,2) * d[2];' ?</SPAN></SPAN></DIV></DIV></DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">Thanks.</DIV>
<DIV class=im>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">Sangma Xie</DIV>
<HR style="MIN-HEIGHT: 1px; WIDTH: 210px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>
<DIV><SPAN style="FONT-FAMILY: 宋体; FONT-SIZE: 10.5pt"><SPAN
style="FONT-FAMILY: Times New Roman"><SPAN style="FONT-SIZE: 10.5pt"><SPAN
style="FONT-SIZE: 10.5pt">Sangma Xie , Master </SPAN> </SPAN>
<DIV><SPAN style="FONT-FAMILY: Times New Roman">Brainnetome Center
<DIV style="FONT-FAMILY: Times New Roman">National Laboratory of Pattern
Recognition (NLPR)</DIV>Institute of Automation, Chinese Academy of Sciences
(CASIA)<BR>95 Zhong Guan Cun East Road, Hai Dian District, Beijing 100190,
P.R.China</SPAN></DIV></SPAN><BR><BR></SPAN></DIV></SPAN></DIV></DIV></DIV><BR>_______________________________________________<BR>Mrtrix-discussion
mailing list<BR><A
href="mailto:Mrtrix-discussion@www.nitrc.org">Mrtrix-discussion@www.nitrc.org</A><BR><A
href="http://www.nitrc.org/mailman/listinfo/mrtrix-discussion"
target=_blank>http://www.nitrc.org/mailman/listinfo/mrtrix-discussion</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all>
<DIV><BR></DIV>-- <BR><FONT color=#ff6600 size=1><B>Dr Jacques-Donald
Tournier<BR></B></FONT>
<DIV><FONT color=#ff6600 size=1>Research Fellow</FONT></DIV>
<DIV><FONT size=1><BR></FONT></DIV>
<DIV><FONT size=1>The Florey Institute of Neuroscience and Mental
Health</FONT></DIV>
<DIV><FONT size=1>Melbourne Brain Centre - Austin Campus</FONT></DIV>
<DIV><FONT size=1>245 Burgundy Street</FONT></DIV>
<DIV><FONT size=1>Heidelberg Vic 3084</FONT></DIV>
<DIV><FONT size=1>Ph: +61 3 9035 7033</FONT></DIV>
<DIV><FONT size=1>Fax: +61 3 9035 7307</FONT></DIV>
<DIV><FONT size=1><A href="http://www.florey.edu.au"
target=_blank>www.florey.edu.au</A></FONT></DIV><BR></DIV></DIV></DIV></BODY></HTML>