|
Documentation.VisualizationTool History
Hide minor edits - Show changes to output
Changed lines 91-92 from:
This produces a tensor volume in which the tensors are rotated 180 degrees about the x axis. Please refer to the man command of [Documentation.TVglyphView | TVglyphView].
to:
This produces a tensor volume in which the tensors are rotated 180 degrees about the x axis. Please refer to the man command of [[Documentation.TVglyphView | TVglyphView]].
Changed lines 91-95 from:
This produces a tensor volume in which the tensors are rotated 180 degrees about the x axis.
ADD A PARAGRAPH ABOUT -TRANS OPTION
to:
This produces a tensor volume in which the tensors are rotated 180 degrees about the x axis. Please refer to the man command of [Documentation.TVglyphView | TVglyphView].
Changed lines 91-93 from:
This produces a tensor volume in which the tensors are rotated 90 degres about the x axis.
to:
This produces a tensor volume in which the tensors are rotated 180 degrees about the x axis.
Changed line 88 from:
TVtool -in tensor.nii.gz -reorient -euler 180 -out reoriented.nii.gz
to:
TVtool -in tensor.nii.gz -reorient -euler 180 0 0 -out reoriented.nii.gz
Deleted lines 61-63:
->[@TVglyphView -in tensor.nii.gz -scale 2 -view axial @]
Changed line 63 from:
TVglyphView -in tensor.nii.gz -scale 2 -view coronal
to:
TVglyphView -in tensor.nii.gz -scale 2 -view axial
Added lines 65-68:
->[@ TVglyphView -in tensor.nii.gz -scale 2 -view coronal @]
Changed lines 87-88 from:
->[@TVtool -in tensor.nii.gz -reorient -euler 180 -out reoriented.nii.gz
to:
->[@ TVtool -in tensor.nii.gz -reorient -euler 180 -out reoriented.nii.gz
Changed lines 101-102 from:
->[@TensorVolumeToImage tensor.nii.gz tensor nii.gz
to:
->[@ TensorVolumeToImage tensor.nii.gz tensor nii.gz
Added lines 4-11:
!!Overview Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter, called [[Documentation.TVglyphView | TVglyphView]]. In the context of spatial normalization, visualization serves the purpose of qualitative quality control. For sanity checks, looking at the FA map is usually sufficient. Here, we discuss three different approaches towards DTI volume visualization, from looking at rotation-invariant scalar indices to visualizing the full tensors.
Changed line 36 from:
->[@ TVglyphView tensor.nii.gz
to:
->[@ TVglyphView -in tensor.nii.gz
Changed lines 5-6 from:
DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as [[http://www.cabiatl.com/mricro/| MRIcro]] and [[http://www.itksnap.org/pmwiki/pmwiki.php|ITK-SNAP]]. The utilities to compute rotation-invariant scalar indices are described [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|here]].
to:
DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as [[http://www.cabiatl.com/mricro/| MRIcro]] and [[http://www.itksnap.org/pmwiki/pmwiki.php|ITK-SNAP]]. A thorough description of the utilities that compute rotation-invariant scalar indices is given [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|here]]. Below are some important examples.
Deleted lines 3-9:
!!Overview Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter. In the context of spatial normalization, visualization serves the purpose of qualitative quality control. For sanity checks, looking at the FA map is usually sufficient. In the following sections, we discuss three different approaches towards DTI volume visualization, from looking at rotation-invariant scalar indices to visualizing the full tensors.
Changed lines 46-112 from:
which displays an axial view of the tensor image.
The following list of the available keystroke controls can be printed using 'H' *'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise *'f'|'F': increase|decrease ellipsoid scaling factor *'r': reset to original view *'s'|'S': rotate in-plane 5 degrees counterclockwise|clockwise *'x': flip left and right *'y': flip up and down *','|'.': go to the slice below|above *'j'|'k': shift the view to left|right *'h'|'l': shift the view up|down *'p': save the current rendering in a png file *'1': toggle the visibility of the tensor glyphs *'2': toggle the visibility of the background or overlay if supplied *'3': toggle the visibility of the outline *'4': toggle the visibility of the red arrow *'5': toggle the visibility of the green arrow *'6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
In order to adjust the visualization of your image, here are all the options available for the usage of TVglyphView
(:table border=3 cellpadding=5 cellspacing=3 align=center:) (:head:) specification (:head:) type (:head:) required (:head:) default (:cellnr align=center:) -in (:cell align=center:) string(s) (:cell align=center:) Y (:cell align=center:) (:cellnr align=center:) -type [--Specify the type of glyph rendering: color orientation (CO), anisotropy scaling (AS), color orientation and anisotropy scaling (COAS), original (OR)--] (:cell align=center:) string(s) (:cell align=center:) N (:cell align=center:) COAS (:cellnr align=center:) -view [-- Specify the slice view: axial, sagittal, or coronal--] (:cell align=center:) string(s) (:cell align=center:) N (:cell align=center:) axial (:cellnr align=center:) -center (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) center of the volume (in voxel unit) (:cellnr align=center:) -size (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) maximum size (:cellnr align=center:) -maxsize (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) 128 128 (:cellnr align=center:) -scale (:cell align=center:) double(s) (:cell align=center:) N (:cell align=center:) 1 (:cellnr align=center:) -overlay (:cell align=center:) string(s) (:cell align=center:) N (:cell align=center:) (:tableend:)
to:
Changed lines 134-136 from:
%lframe height=250%Attach:axial_tensor.png %height=250%Attach:coronal_tensor.png
to:
%height=250%Attach:axial_tensor.png %height=250%Attach:coronal_tensor.png \\
Changed lines 146-150 from:
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components. In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz
to:
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components. In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool| TVtool]] using the flag ''-reorient -euler theta phi psi'', which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage: ->[@TVtool -in tensor.nii.gz -reorient -euler 180 -out reoriented.nii.gz
Added lines 153-157:
This produces a tensor volume in which the tensors are rotated 90 degres about the x axis. ADD A PARAGRAPH ABOUT -TRANS OPTION
Added line 159:
Changed line 166 from:
#Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
to:
#Using the most recent version of [[http://www.cabiatl.com/mricro/mricron/index.html | MRIcron]], you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
Changed lines 66-68 from:
to:
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
Changed lines 125-129 from:
The figures below illustrate the axial and coronal views produced for the example data.
%lframe height=200%Attach:axial_tensor.png %height=200%Attach:coronal_tensor.png
to:
The figures below illustrate the axial and coronal views produced using the following commands: ->[@TVglyphView -in tensor.nii.gz -scale 2 -view axial @] ->[@ TVglyphView -in tensor.nii.gz -scale 2 -view coronal @] The scale factor was increased from 1 (default) to 2 in order for the tensors to be more visible. %lframe height=250%Attach:axial_tensor.png %height=250%Attach:coronal_tensor.png
Deleted lines 138-160:
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
Changed lines 125-127 from:
%lframe width=300%Attach:axial_tensor.png Attach:coronal_tensor.png
to:
%lframe height=200%Attach:axial_tensor.png %height=200%Attach:coronal_tensor.png
Changed lines 125-127 from:
%lframe width=300%Attach:axial_tensor.png %rframe width=300%Attach:coronal_tensor.png
to:
%lframe width=300%Attach:axial_tensor.png Attach:coronal_tensor.png
Changed lines 125-127 from:
%lframe width=500%Attach:axial_tensor.png %rframe width=500%Attach:coronal_tensor.png
to:
%lframe width=300%Attach:axial_tensor.png %rframe width=300%Attach:coronal_tensor.png
Changed lines 49-66 from:
'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
to:
*'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise *'f'|'F': increase|decrease ellipsoid scaling factor *'r': reset to original view *'s'|'S': rotate in-plane 5 degrees counterclockwise|clockwise *'x': flip left and right *'y': flip up and down *','|'.': go to the slice below|above *'j'|'k': shift the view to left|right *'h'|'l': shift the view up|down *'p': save the current rendering in a png file *'1': toggle the visibility of the tensor glyphs *'2': toggle the visibility of the background or overlay if supplied *'3': toggle the visibility of the outline *'4': toggle the visibility of the red arrow *'5': toggle the visibility of the green arrow *'6': toggle the visibility of the blue arrow
Deleted line 122:
Added lines 125-127:
%lframe width=500%Attach:axial_tensor.png %rframe width=500%Attach:coronal_tensor.png
Changed lines 67-68 from:
In order to adjust the visualization of your image, here is another list for the complete usage of TVglyphView
to:
In order to adjust the visualization of your image, here are all the options available for the usage of TVglyphView
Changed lines 111-116 from:
********** first determine the dimensions of the volume, if not yet done. You can use the command
to:
If not yet done, you can know more about your tensor image by using the command that can help tweaking the TVglyphView visualization parameters
Deleted lines 123-128:
Added line 79:
[--Specify the type of glyph rendering: color orientation (CO), anisotropy scaling (AS), color orientation and anisotropy scaling (COAS), original (OR)--]
Changed line 82 from:
(:cell align=center:) COAS Specify the type of glyph rendering: color orientation (CO), anisotropy scaling (AS), color orientation and anisotropy scaling (COAS), original (OR)
to:
(:cell align=center:) COAS
Added line 84:
[-- Specify the slice view: axial, sagittal, or coronal--]
Changed line 87 from:
(:cell align=center:) axial Specify the slice view: axial, sagittal, or coronal, default to axial
to:
(:cell align=center:) axial
Changed line 91 from:
(:cell align=center:) If not specified, will use the center of the volume (in voxel unit)
to:
(:cell align=center:) center of the volume (in voxel unit)
Changed line 95 from:
(:cell align=center:) If not specified, will use the maximum size
to:
(:cell align=center:) maximum size
Changed lines 85-86 from:
(:cell align=center:) axial (:cell align=center:) Specify the slice view: axial, sagittal, or coronal, default to axial
to:
(:cell align=center:) axial Specify the slice view: axial, sagittal, or coronal, default to axial
Changed lines 104-105 from:
to:
(:cell align=center:) N (:cell align=center:)
Changed lines 15-16 from:
[[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|TVtool]] can be used to compute the principal diffusion direction map of a DTI volume or to map the principal diffusion direction into the corresponding RGB map, which can be visualized using ITK-SNAP.
to:
[[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|TVtool]] can be used to compute the principal diffusion direction map of a DTI volume or to generate the principal diffusion direction mapped into the corresponding RGB map, which can be visualized using ITK-SNAP.
Changed lines 25-26 from:
outputs the RGB map ''tensor_rgb.nii.g'' that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command
to:
outputs the principal direction RGB map ''tensor_rgb.nii.g'' that can be directly loaded into ITK-SNAP for viewing. To tune the saturation level of colors, you can use the following command (if not supplied, the default value is 1.0):
Changed lines 41-43 from:
DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command ->[@ VolumeInfo tensor.nii.gz
to:
DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, simply type the command ->[@ TVglyphView tensor.nii.gz
Changed lines 46-70 from:
The output should look like ->[@Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0] @]
which suggests that there are 112, 112, and 60 slices along x (sagittal), y (coronal) and z (axial) dimensions, respectively.
To visualize an axial slice of this volume, e.g., the axial slice 30, the command will be
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0 @]
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0 @]
The figures below illustrate the axial and coronal views produced for the example data.
IMPORTANT: If you find that, to see the ellipsoids rendered like the figures above, you have to increase the scaling number from 1.0 to a significantly larger number like 1000.0, it is a good sign that you have to adjust the diffusivity of your DTI volume.
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list
to:
which displays an axial view of the tensor image.
The following list of the available keystroke controls can be printed using 'H'
Changed lines 66-79 from:
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
!!Checking if tensors are correctly reconstructed An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
The two steps are: # Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium. # Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components.
In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz
to:
In order to adjust the visualization of your image, here is another list for the complete usage of TVglyphView
(:table border=3 cellpadding=5 cellspacing=3 align=center:) (:head:) specification (:head:) type (:head:) required (:head:) default (:cellnr align=center:) -in (:cell align=center:) string(s) (:cell align=center:) Y (:cell align=center:) (:cellnr align=center:) -type (:cell align=center:) string(s) (:cell align=center:) N (:cell align=center:) COAS Specify the type of glyph rendering: color orientation (CO), anisotropy scaling (AS), color orientation and anisotropy scaling (COAS), original (OR) (:cellnr align=center:) -view (:cell align=center:) string(s) (:cell align=center:) N (:cell align=center:) axial (:cell align=center:) Specify the slice view: axial, sagittal, or coronal, default to axial (:cellnr align=center:) -center (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) If not specified, will use the center of the volume (in voxel unit) (:cellnr align=center:) -size (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) If not specified, will use the maximum size (:cellnr align=center:) -maxsize (:cell align=center:) integer(s) (:cell align=center:) N (:cell align=center:) 128 128 (:cellnr align=center:) -scale (:cell align=center:) double(s) (:cell align=center:) N (:cell align=center:) 1 (:cellnr align=center:) -overlay (:cell align=center:) string(s) (:cell align=center:) N (:tableend:)
********** first determine the dimensions of the volume, if not yet done. You can use the command
->[@ VolumeInfo tensor.nii.gz
Added lines 118-172:
The output should look like ->[@Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0] @]
which suggests that there are 112, 112, and 60 slices along x (sagittal), y (coronal) and z (axial) dimensions, respectively.
The figures below illustrate the axial and coronal views produced for the example data.
IMPORTANT: If you find that, to see the ellipsoids rendered like the figures above, you have to increase the scaling number from 1.0 to a significantly larger number like 1000.0, it is a good sign that you have to adjust the diffusivity of your DTI volume.
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
!!Checking if tensors are correctly reconstructed An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
The two steps are: # Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium. # Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components.
In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz @]
Changed lines 31-33 from:
%width=100%Attach:rgb_image.png
to:
%width=500%Attach:rgb_image.png
Changed lines 31-33 from:
%width=10cm%Attach:rgb_image.png
to:
%width=100%Attach:rgb_image.png
Changed lines 31-33 from:
to:
%width=10cm%Attach:rgb_image.png
Changed lines 31-32 from:
to:
Changed lines 2-3 from:
! Visualizing DTI images with DTI-TK
to:
! Visualizing DTI images with DTI-TK (draft)
Changed lines 5-6 from:
Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
to:
Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
Deleted line 11:
Added line 16:
Added line 19:
Added line 24:
Changed lines 32-34 from:
%width=400px% Attach:rgb_image.png
to:
Changed line 34 from:
to:
Changed lines 40-41 from:
DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command
to:
DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command
Changed lines 57-58 from:
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
to:
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
Changed lines 66-86 from:
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list
'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor
'r': reset to original view
's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise
'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
to:
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes: List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
Changed lines 90-92 from:
An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
to:
An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
Deleted line 92:
Deleted line 93:
Changed lines 96-100 from:
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components. In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
to:
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components. In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
Deleted line 103:
Changed lines 105-107 from:
# Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
to:
#Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
Changed line 110 from:
# Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
to:
#Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
Added lines 1-116:
(:noleft:) (:notitle:)(:title Visualization:) ! Visualizing DTI images with DTI-TK
!!Overview Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
In the context of spatial normalization, visualization serves the purpose of qualitative quality control. For sanity checks, looking at the FA map is usually sufficient.
In the following sections, we discuss three different approaches towards DTI volume visualization, from looking at rotation-invariant scalar indices to visualizing the full tensors.
!!Viewing the rotation-invariant scalar indices
DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as [[http://www.cabiatl.com/mricro/| MRIcro]] and [[http://www.itksnap.org/pmwiki/pmwiki.php|ITK-SNAP]]. The utilities to compute rotation-invariant scalar indices are described [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|here]].
!!Viewing the RGB map of the principal diffusion directions [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|TVtool]] can be used to compute the principal diffusion direction map of a DTI volume or to map the principal diffusion direction into the corresponding RGB map, which can be visualized using ITK-SNAP. ->[@ TVtool -in tensor.nii.gz -pd @] outputs the principal direction map ''tensor_pd.nii.gz''
->[@ TVtool -in tensor.nii.gz -rgb @] outputs the RGB map ''tensor_rgb.nii.g'' that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command
->[@ TO BE COMPLETED @] will increase the color saturation. The figure below illustrates the RGB map produced from the example data.
%width=400px% Attach:rgb_image.png
IMPORTANT WARNING: There are two shortcomings to visualizing a DTI volume using the RGB map. One is that the mapping from principal diffusion directions (unit vectors) to RGB codes is a many-to-one function. More specifically, the vectors derived from some unit vector (x, y, z) by flipping the sign(s) of X, Y or Z component(s) will be mapped to the same RGB code, despite many of these vectors have distinctly different orientations in space.
The second shortcoming is that, around the interfaces of white matter fiber bundles that traverse orthogonal to each other, the principal diffusion directions derived from diffusion tensors do not generally correspond to the orientation of the underlying fiber bundles.
!!Viewing the tensors using 3D ellipsoid glyphs DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command
->[@ VolumeInfo tensor.nii.gz @]
The output should look like ->[@Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0] @]
which suggests that there are 112, 112, and 60 slices along x (sagittal), y (coronal) and z (axial) dimensions, respectively.
To visualize an axial slice of this volume, e.g., the axial slice 30, the command will be
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0 @]
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0 @]
The figures below illustrate the axial and coronal views produced for the example data.
IMPORTANT: If you find that, to see the ellipsoids rendered like the figures above, you have to increase the scaling number from 1.0 to a significantly larger number like 1000.0, it is a good sign that you have to adjust the diffusivity of your DTI volume.
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
!!Checking if tensors are correctly reconstructed
An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
The two steps are:
# Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium.
# Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components.
In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz @]
!!Viewing the tensor component images
There are two ways to view the actual tensor components, i.e., Dxx, Dyx, etc.
# Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
->[@TensorVolumeToImage tensor.nii.gz tensor nii.gz @]
# Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
Deleted lines 0-115:
(:noleft:) (:notitle:)(:title Visualization:) ! Visualizing DTI images with DTI-TK
!!Overview Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
In the context of spatial normalization, visualization serves the purpose of qualitative quality control. For sanity checks, looking at the FA map is usually sufficient.
In the following sections, we discuss three different approaches towards DTI volume visualization, from looking at rotation-invariant scalar indices to visualizing the full tensors.
!!Viewing the rotation-invariant scalar indices
DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as [[http://www.cabiatl.com/mricro/| MRIcro]] and [[http://www.itksnap.org/pmwiki/pmwiki.php|ITK-SNAP]]. The utilities to compute rotation-invariant scalar indices are described [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|here]].
!!Viewing the RGB map of the principal diffusion directions [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|TVtool]] can be used to compute the principal diffusion direction map of a DTI volume or to map the principal diffusion direction into the corresponding RGB map, which can be visualized using ITK-SNAP. ->[@ TVtool -in tensor.nii.gz -pd @] outputs the principal direction map ''tensor_pd.nii.gz''
->[@ TVtool -in tensor.nii.gz -rgb @] outputs the RGB map ''tensor_rgb.nii.g'' that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command
->[@ TO BE COMPLETED @] will increase the color saturation. The figure below illustrates the RGB map produced from the example data.
%width=400px% Attach:rgb_image.png
IMPORTANT WARNING: There are two shortcomings to visualizing a DTI volume using the RGB map. One is that the mapping from principal diffusion directions (unit vectors) to RGB codes is a many-to-one function. More specifically, the vectors derived from some unit vector (x, y, z) by flipping the sign(s) of X, Y or Z component(s) will be mapped to the same RGB code, despite many of these vectors have distinctly different orientations in space.
The second shortcoming is that, around the interfaces of white matter fiber bundles that traverse orthogonal to each other, the principal diffusion directions derived from diffusion tensors do not generally correspond to the orientation of the underlying fiber bundles.
!!Viewing the tensors using 3D ellipsoid glyphs DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command
->[@ VolumeInfo tensor.nii.gz @]
The output should look like ->[@Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0] @]
which suggests that there are 112, 112, and 60 slices along x (sagittal), y (coronal) and z (axial) dimensions, respectively.
To visualize an axial slice of this volume, e.g., the axial slice 30, the command will be
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0 @]
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0 @]
The figures below illustrate the axial and coronal views produced for the example data.
IMPORTANT: If you find that, to see the ellipsoids rendered like the figures above, you have to increase the scaling number from 1.0 to a significantly larger number like 1000.0, it is a good sign that you have to adjust the diffusivity of your DTI volume.
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
!!Checking if tensors are correctly reconstructed
An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
The two steps are:
# Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium.
# Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components.
In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz @]
!!Viewing the tensor component images
There are two ways to view the actual tensor components, i.e., Dxx, Dyx, etc.
# Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
->[@TensorVolumeToImage tensor.nii.gz tensor nii.gz @]
# Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
Changed lines 42-43 from:
$ VolumeInfo tensor.nii.gz
to:
->[@ VolumeInfo tensor.nii.gz @]
Changed lines 47-49 from:
Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0]
to:
->[@Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0] @]
Changed lines 54-55 from:
$ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0
to:
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0 @]
Changed lines 59-60 from:
$ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0
to:
->[@ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0 @]
Changed lines 89-90 from:
!! Checking if tensors are correctly reconstructed
to:
!!Checking if tensors are correctly reconstructed
Changed lines 104-107 from:
$ TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz !! Viewing the tensor component images
to:
->[@TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz @] !!Viewing the tensor component images
Changed lines 113-114 from:
$ TensorVolumeToImage tensor.nii.gz tensor nii.gz
to:
->[@TensorVolumeToImage tensor.nii.gz tensor nii.gz @]
Changed lines 30-32 from:
%lframe width=400px% Attach:rgb_image.png
to:
%width=400px% Attach:rgb_image.png
Changed lines 86-87 from:
5. Checking if tensors are correctly reconstructed
to:
!! Checking if tensors are correctly reconstructed
Changed lines 92-95 from:
1) Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium.
2) Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
to:
# Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium. # Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
Changed lines 103-104 from:
6. Viewing the tensor component images
to:
!! Viewing the tensor component images
Changed lines 107-108 from:
1) Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
to:
# Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
Changed line 111 from:
2) Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
to:
# Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
Changed lines 30-32 from:
%rframe width=50px% Attach:rgb_image.png
to:
%lframe width=400px% Attach:rgb_image.png
Changed lines 30-32 from:
%rframe% Attach:rgb_image.png
to:
%rframe width=50px% Attach:rgb_image.png
Changed lines 30-32 from:
%rframe% Attach:ellipsoid_axial.png
to:
%rframe% Attach:rgb_image.png
Changed lines 39-44 from:
4. Viewing the tensors using 3D ellipsoid glyphs
to:
!!Viewing the tensors using 3D ellipsoid glyphs DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command $ VolumeInfo tensor.nii.gz The output should look like
Deleted lines 45-50:
DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command $ VolumeInfo tensor.nii.gz The output should look like
Changed lines 30-32 from:
%lframe% Attach: rgb_image.png
to:
%rframe% Attach:ellipsoid_axial.png
Changed lines 30-32 from:
%lframe% Attach:rgb_image.tiff
to:
%lframe% Attach: rgb_image.png
Changed lines 1-4 from:
1. Overview
Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map and the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
to:
(:noleft:) (:notitle:)(:title Visualization:) ! Visualizing DTI images with DTI-TK !!Overview Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map nor the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
Changed lines 11-23 from:
2. Viewing the rotation-invariant scalar indices DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as MRIcro and ITK-SNAP. The utilities to compute rotation-invariant scalar indices are described here . 3. Viewing the RGB map of the principal diffusion directions DTI-TK implements a utility to compute the principal diffusion direction map of a DTI volume and another utility for mapping the principal diffusion direction map into the corresponding RGB map that can be visualized using ITK-SNAP. The two utilities have been wrapped into a single bash script "pdrgb". The following command
$ pdrgb tensor.nii.gz
will output a RGB map "tensor_pd.mha" that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command $ pdrgb tensor.nii.gz 1.5
to:
!!Viewing the rotation-invariant scalar indices DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as [[http://www.cabiatl.com/mricro/| MRIcro]] and [[http://www.itksnap.org/pmwiki/pmwiki.php|ITK-SNAP]]. The utilities to compute rotation-invariant scalar indices are described [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|here]]. !!Viewing the RGB map of the principal diffusion directions [[http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.TVtool|TVtool]] can be used to compute the principal diffusion direction map of a DTI volume or to map the principal diffusion direction into the corresponding RGB map, which can be visualized using ITK-SNAP. ->[@ TVtool -in tensor.nii.gz -pd @] outputs the principal direction map ''tensor_pd.nii.gz'' ->[@ TVtool -in tensor.nii.gz -rgb @] outputs the RGB map ''tensor_rgb.nii.g'' that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command ->[@ TO BE COMPLETED @]
Added lines 30-32:
%lframe% Attach:rgb_image.tiff
Added lines 1-104:
1. Overview
Effective visualization of DTI volumes is critically important for processing and analyzing this type of data. For example, after reconstructing a DTI volume from the raw diffusion-weighted images (DWIs), it is imperative to examine if the tensors are properly oriented in space. For this purpose, neither the FA map and the RGB map of the principal diffusion directions suffice. It is necessary to visualize the principal diffusion direction as 3D vectors or to visualize the tensors as 3D tensor glyphs. DTI-TK offers a simple tool for the latter.
In the context of spatial normalization, visualization serves the purpose of qualitative quality control. For sanity checks, looking at the FA map is usually sufficient.
In the following sections, we discuss three different approaches towards DTI volume visualization, from looking at rotation-invariant scalar indices to visualizing the full tensors.
2. Viewing the rotation-invariant scalar indices
DTI-TK implements the utilities to compute the common rotation-invariant scalar indices derived from a DTI volume. The scalar index volumes are saved in NIfTI format and can be visualized using any Analyze/NIfTI supported viewers, such as MRIcro and ITK-SNAP. The utilities to compute rotation-invariant scalar indices are described here .
3. Viewing the RGB map of the principal diffusion directions
DTI-TK implements a utility to compute the principal diffusion direction map of a DTI volume and another utility for mapping the principal diffusion direction map into the corresponding RGB map that can be visualized using ITK-SNAP. The two utilities have been wrapped into a single bash script "pdrgb". The following command
$ pdrgb tensor.nii.gz
will output a RGB map "tensor_pd.mha" that can be directly loaded into ITK-SNAP for viewing. The script also allows for an additional parameter to tune the saturation level of colors. If not supplied, the default value is 1.0. The command
$ pdrgb tensor.nii.gz 1.5 will increase the color saturation. The figure below illustrates the RGB map produced from the example data.
IMPORTANT WARNING: There are two shortcomings to visualizing a DTI volume using the RGB map. One is that the mapping from principal diffusion directions (unit vectors) to RGB codes is a many-to-one function. More specifically, the vectors derived from some unit vector (x, y, z) by flipping the sign(s) of X, Y or Z component(s) will be mapped to the same RGB code, despite many of these vectors have distinctly different orientations in space.
The second shortcoming is that, around the interfaces of white matter fiber bundles that traverse orthogonal to each other, the principal diffusion directions derived from diffusion tensors do not generally correspond to the orientation of the underlying fiber bundles.
4. Viewing the tensors using 3D ellipsoid glyphs DTI-TK implements tools for visualizing the tensors in terms of 3D ellipsoid glyphs and these tools are aimed to remedy the shortcomings of RGB-based visualization discussed above. To visualize a DTI volume, first determine the dimensions of the volume, if not yet done. You can use the command
$ VolumeInfo tensor.nii.gz
The output should look like Volume Info of tensor.nii.gz size: 112x112x60, voxel size: 2x2x2, origin: [0, 0, 0]
which suggests that there are 112, 112, and 60 slices along x (sagittal), y (coronal) and z (axial) dimensions, respectively.
To visualize an axial slice of this volume, e.g., the axial slice 30, the command will be
$ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 0 111 29 29 1.0
The last number adjusts the scaling of the ellipsoid sizes, while the other integers specify a bounding box, or a bounding slice to be more precise. The first two integers specify the range of x slices, the middle two the range of y slices, and the last two the range of z slices. Note that the slices are indexed beginning from 0. By setting the two integers for the z slices to be identical, the program is instructed to show an axial slice. Similarly, the following command will show a coronal slice through the volume (the coronal slice 56)
$ ellipsoidImageColOriAniScl tensor.nii.gz 0 111 55 55 0 59 1.0
The figures below illustrate the axial and coronal views produced for the example data.
IMPORTANT: If you find that, to see the ellipsoids rendered like the figures above, you have to increase the scaling number from 1.0 to a significantly larger number like 1000.0, it is a good sign that you have to adjust the diffusivity of your DTI volume.
The ellipsoidImageColOriAniScl has a number of useful functionalities which are accessed via keystroke controls. Hit the key 'H' will print out the complete list of keyboard controls. The list includes:
List of the available keystroke controls 'H': print this keystroke control list 'a'|'A': rotate out-of-plane 5 degrees counterclockwise|clockwise 'f'|'F': increase|decrease ellipsoid scaling factor 'r': reset to original view 's'|'S': rotate in-plane 5 degrees counterclockwise|clockwise 'x': flip left and right 'y': flip up and down ','|'.': go to the slice below|above 'j'|'k': shift the view to left|right 'h'|'l': shift the view up|down 'p': save the current rendering in a png file '1': toggle the visibility of the tensor glyphs '2': toggle the visibility of the background or overlay if supplied '3': toggle the visibility of the outline '4': toggle the visibility of the red arrow '5': toggle the visibility of the green arrow '6': toggle the visibility of the blue arrow
One of the most useful features is the ability to scroll through the slices. However, because the 3D visualization is a computational intensive operation, it is recommended to toggle the visibility of the tensor glyphs to off when you need to scroll to a different slice. Then toggle the visibility back on when you get to the slice you'd like to visualize with the tensor glyphs.
5. Checking if tensors are correctly reconstructed
An important utility of the tensor glyph rendering described above is for checking the correctness of your tensor reconstruction. A common mistake during tensor reconstruction (the process of constructing tensor volumes from diffusion-weighted images) is using a gradient table that is not corrected for the difference between the coordinate frame in which the gradient table is defined and the one in which the image is defined. This type of erroneous reconstruction can not be detected with the RGB map (explained above) and need to be ruled out with the tensor glyph rendering.
The two steps are:
1) Check if the tensors are oriented correctly in the genu and the splenium of the corpus callosum in the axial view (shown above). The tensors' major axes should be clearly aligned along the boundary of the genu and the splenium.
2) Check if the tensors are oriented correctly in the internal capsule and the midbody of the corpus callosum in the coronal view (also shown above). Again, the tensors should be properly aligned with the boundary of these structures.
To correct for any errors that you identify, you need to first modify the gradient table, then repeat the tensor reconstruction. The modification of the gradient table typically involves flipping the signs of the x or y component of all gradient vectors. To determine the correct flipping of the signs in a systematic way, it is necessary to understand why this happens. The reason is that the gradient directions are always defined with respect to some right-handed frame of reference, while the frame of reference of the acquired image data is typically NOT right-handed. This mismatch is the cause of the problem. The sign flipping intends to fix this mismatch and the key is to identify the difference between the two frames of reference in question. In our experience, if the data is acquired on SIEMENS scanners, the signs of x gradient components need to be flipped; for GE scanners, it is usually the y components.
In the event that you prefer not to redo the tensor reconstruction, you can correct the tensor orientations with the tool TVReorient, which allows you to specify the appropriate rotation, in terms of Euler angles, that should be applied to each tensor in the volume. The Euler angles are theta, the rotation about x axis, phi, the rotation about y axis, and psi, the rotation about z axis. The sign flipping of x component is equivalent to setting theta to 180 degrees, phi and psi to 0 degrees. Similarly, the flipping of y component is equivalent to setting phi to 180 degrees, theta and psi to 0 degrees. Here is an example usage:
$ TVReorient -in input.nii.gz -theta 180 -out reoriented.nii.gz
6. Viewing the tensor component images
There are two ways to view the actual tensor components, i.e., Dxx, Dyx, etc.
1) Using TensorVolumeToImage, you can split a DTI volume in NIfTI format into six scalar NIfTI volumes. Each scalar volume contains one of the six tensor components and can be viewed with standard volume viewers, such as ITK-SNAP. Below is an example usage of TensorVolumeToImage applied to the provided sample data.
$ TensorVolumeToImage tensor.nii.gz tensor nii.gz
2) Using the most recent version of MRIcron, you can load a DTI volume in NIfTI format directly. The program will prompt you to pick the tensor component that you'd like to view.
|
|