Computing The Tensor
Having set up the gradients and b-matrices, set the input images, and setup for warp correction (if necessary), you are now in a position to compute the tensor images. You will need to decide on several settings in the Tensor Calculation panel:

-
Fit type. You can fit various types of tensor to the diffusion-weighted data.
- Isotropic. The fitted tensor is isotropic - all elements on the diagonal are equal, and off-diagonal elements are zero. Not appropriate if you wish to visualise anisotropy, directionality or perform tractography. It will only produce a meaningful diffusion tensor trace image, and only then in regions of the image where the diffusion is truly isotropic.
- Linear. A general symmetric tensor fitted using linear regression. This is fast to compute and is the usual way to compute the tensor.
- Non-Linear. A general symmetric tensor fitted using non-linear regression. This is slower to compute, but might lead to a slightly more robust tensor calculation when the signal-to-noise ratio is very low.
- Axi-Symmetric. An axi-symmetrical tensor fitted using non-linear regression. An axi-symmetric tensor has two eigen values which are equal, and therefore there are fewer fit parameters to estimate. This can improve the robustness of principal direction estimation when the signal-to-noise ratio is poor.
-
You can mask the input image, so that the computation of the tensor is only performed for pixels inside the mask; for pixels outside the mask, the output images will have a zero pixel value. Use the standard image masking options to use a mask.
-
Threshold. Computation of the tensor in the noise background is slow, and the result is meaningless noise. You can speed up computation and produce nicer-looking output images if you provide a threshold. The tensor is not computed in pixels where the intensity in all the input images is below the threshold.
-
Output base name. Set the base name for the output images. The output images will be created in the same folder as the input images, and will start with the base name supplied. For example, if you supply a base name of
Test, the following output images will be produced:TestM0- non-diffusion-weighted signal intensity image.TestTrace- the diffusion tensor Trace image.TestDirn- a colour-coded principal diffusivity direction image. The coding is such that the horizontal component of the principal diffusion direction is coloured red; the vertical component is coloured green, and the through-slice component is coloured blue.TestFA- fractional anisotropy image.TestRA- relative anisotropy image.TestDAx- axial diffusivity image - the diffusivity in the direction of the primary eigen vector (primary eigen value).TestDRad- radial diffusivity image - the average of the second and third eigen values.TestDT- a 4-dimensional image showing all elements of the diffusion tensor. The image will have a size of six in the fourth dimension, and will show the elements of the tensor in the order Dxx, Dxy, Dxz, Dyy, Dyz and Dzz. This image is needed if you wish to go on to perform tractography.
-
Select the
check-box if you want Brain Finder to try to isolate the brain before the tensor is computed over the brain. This is, of course, only useful if your you have performed diffusion imaging of the brain.
-
Gradient sign convention. The gradients specification, assumes that:
- When a positive x-magnetic field gradient is applied, the magnetic field increases from the image left to the image right. If the opposite is true, then select the
button. - When a positive y-magnetic field gradient is applied, the magnetic field increases from the image top to the image bottom. If the opposite is true, then select the
button. - When a positive z-magnetic field gradient is applied, the magnetic field increases from the first slice position to the last slice position. If the opposite is true, then select the
button.
Note: if you only want to compute and display the scalar invariants of the diffusion tensor, and do not want to go on to perform tractography, the sign of the gradient convention does not matter. If you do go on to perform tractography, there is a further opportunity there to set the correct gradient sign convention.
- When a positive x-magnetic field gradient is applied, the magnetic field increases from the image left to the image right. If the opposite is true, then select the
-
Reorient. By default, the output images will have the same set of slice locations as the input images. However, you have the option to reorient the output images, for example changing the orientation from axial to coronal. To do this, select the
check-box. Select the orientation required by clicking on the appropriate button in the New orientationpanel.
Jim may be able to determine the orientation of the original image (which it needs in order to perform the reorientation correctly). If it cannot, you will see an error message; in this case, tell Jim the original orientation by selecting the
check box and clicking on the appropriate button in the Current orientationpanel.
By default, Jim assumes that the ordering of the image slices follows the standard radiological convention (slice number increasing from right to left, from anterior to posterior, and from inferior to superior). If your image slices do not follow this convention, then the re-oriented image will also not follow convention. If this happens, and you see (for example) in your reoriented image that the anterior portion of the patient is towards the bottom of the screen, then click the
check-box to tell Jim that your image slice order does not follow the standard radiological convention.
You are now ready to compute the tensor: click the
button. If you obtain satisfactory results, you can save the whole setup by clicking the
button. Then, the next time you use the Diffusion Analysis tool, the same settings will be retrieved. To revert to the default setting, click the
.
Below are some typical output images for one slice.
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|
| M0 | Trace | Fractional anisotropy | Relative anisotropy |
![]() |
![]() |
![]() |
|
| Axial diffusivity | Radial diffusivity | Direction |
Also output is the full diffusion tensor. This is a 4-dimensional dataset, containing the six unique elements of the tensor in the order Dxx, Dxy, Dxz, Dyy, Dyz, Dzz, shown below:

Note: the Dxx elements for all slices are followed by the Dxy elements for all slices, etc.
Having computed the diffusion tensor (and its scalar rotational invariants), you can go on to used the outputted Diffusion Tensor (DT) image to perform tractography.






