This page details the format of files used to specify the diffusion-weighting gradient vectors and b-matrices used in warp correction and tensor calculation in the Diffusion Analysis tool. The gradient specification file is an XML file, with a document type definition of:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE GradSpec [
<!ELEMENT GradSpec ((GradVecs|bMatrices)|(GradVecs, bMatrices)|(bMatrices, GradVecs))>
<!ELEMENT GradVecs (bValue?, GradVec+)>
<!ELEMENT bMatrices (bMatrix+)>
<!ELEMENT bValue (#PCDATA)>
<!ELEMENT GradVec EMPTY>
<!ELEMENT bMatrix EMPTY>
<!ATTLIST GradVec Gx CDATA #REQUIRED Gy CDATA #REQUIRED Gz CDATA #REQUIRED>
<!ATTLIST bMatrix Bxx CDATA #REQUIRED Bxy CDATA #REQUIRED Bxz CDATA #REQUIRED Byy CDATA #REQUIRED Byz CDATA #RE
QUIRED Bzz CDATA #REQUIRED >
]>
An example gradient specification file is shown below for an acquisition with
sixteen diffusion weighting directions, including one image acquired with no
diffusion weighting.
<!--GradSpec created by Jim on "02 Aug 2013 12:24:55.344 British Summer Time" by Operator ID "xinapse"-->
<GradSpec>
<GradVecs>
<bValue>800.0</bValue>
<GradVec Gx="0.0" Gy="0.0" Gz="0.0"/>
<GradVec Gx="-0.7071" Gy="-0.7071" Gz="-1.0"/>
<GradVec Gx="-0.7071" Gy="-0.7071" Gz="1.0"/>
<GradVec Gx="1.0" Gy="-1.0" Gz="0.0"/>
<GradVec Gx="-0.1561" Gy="-0.9999" Gz="-0.9879"/>
<GradVec Gx="0.4091" Gy="-0.9894" Gz="-0.924"/>
<GradVec Gx="0.8874" Gy="-0.4674" Gz="-0.997"/>
<GradVec Gx="0.9297" Gy="-0.3866" Gz="-0.993"/>
<GradVec Gx="-0.9511" Gy="-0.7667" Gz="-0.7124"/>
<GradVec Gx="0.9954" Gy="-0.6945" Gz="0.7259"/>
<GradVec Gx="-0.98" Gy="-0.358" Gz="0.9547"/>
<GradVec Gx="-0.9992" Gy="-1.0" Gz="0.0392"/>
<GradVec Gx="-0.3989" Gy="-0.9999" Gz="0.9171"/>
<GradVec Gx="0.4082" Gy="-0.9923" Gz="0.9213"/>
<GradVec Gx="0.9982" Gy="-0.9989" Gz="0.0759"/>
<GradVec Gx="0.9919" Gy="-0.2899" Gz="0.9655"/>
</GradVecs>
<bMatrices>
<bMatrix Bxx="0.0" Bxy="0.0" Bxz="0.0" Byy="0.0" Byz="0.0" Bzz="0.0"/>
<bMatrix Bxx="499.9904" Bxy="499.9904" Bxz="707.1" Byy="499.9904" Byz="707.1" Bzz="1000.0"/>
<bMatrix Bxx="499.9904" Bxy="499.9904" Bxz="-707.1" Byy="499.9904" Byz="-707.1" Bzz="1000.0"/>
<bMatrix Bxx="1000.0" Bxy="-1000.0" Bxz="0.0" Byy="1000.0" Byz="-0.0" Bzz="0.0"/>
<bMatrix Bxx="24.367212" Bxy="156.08438" Bxz="154.2112" Byy="999.8" Byz="987.8012" Bzz="975.9464"/>
<bMatrix Bxx="167.36281" Bxy="-404.76355" Bxz="-378.0084" Byy="978.9124" Byz="914.2057" Bzz="853.77606"/>
<bMatrix Bxx="787.4787" Bxy="-414.77075" Bxz="-884.73773" Byy="218.46278" Byz="465.9978" Bzz="994.009"/>
<bMatrix Bxx="864.3421" Bxy="-359.42203" Bxz="-923.1921" Byy="149.45955" Byz="383.8938" Bzz="986.04895"/>
<bMatrix Bxx="904.5912" Bxy="729.20844" Bxz="677.56366" Byy="587.8289" Byz="546.19714" Bzz="507.51376"/>
<bMatrix Bxx="990.82117" Bxy="-691.30536" Bxz="722.5609" Byy="482.3303" Byz="-504.13757" Bzz="526.9308"/>
<bMatrix Bxx="960.4" Bxy="350.84" Bxz="-935.606" Byy="128.164" Byz="-341.7826" Bzz="911.452"/>
<bMatrix Bxx="998.40063" Bxy="999.2" Bxz="-39.16864" Byy="1000.0" Byz="-39.2" Bzz="1.53664"/>
<bMatrix Bxx="159.12122" Bxy="398.8601" Bxz="-365.8312" Byy="999.8" Byz="-917.0083" Bzz="841.07245"/>
<bMatrix Bxx="166.62724" Bxy="-405.05682" Bxz="376.07465" Byy="984.65924" Byz="-914.206" Bzz="848.7937"/>
<bMatrix Bxx="996.4032" Bxy="-997.102" Bxz="75.76338" Byy="997.8012" Byz="-75.81651" Bzz="5.7608104"/>
<bMatrix Bxx="983.86566" Bxy="-287.55182" Bxz="957.67944" Byy="84.042015" Byz="-279.89847" Bzz="932.19025"/>
</bMatrices>
</GradSpec>