<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matsuij</id>
	<title>Slicer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matsuij"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/wiki/Special:Contributions/Matsuij"/>
	<updated>2026-06-22T06:54:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19376</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19376"/>
		<updated>2011-03-14T20:27:36Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the '''smallGradientThreshold''' flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient vectors whose magnitudes were unusually small in Siemens Trio Tim B13 data due to incorrect metadata for diffusion gradient vector coordinate entries in the DICOM header public element tags.&lt;br /&gt;
&lt;br /&gt;
'''For Siemens data:''' In event of incorrect metadata for diffusion gradient vector coordinates in the DICOM header public element tags, please set the '''useBMatrixGradientDirections''' flag. When the useBMatrixGradientDirections flag is set, gradient direction coordinates and b values are derived from the '''bMatrix''' DICOM header private element tag for each gradient. In Siemens DWI data, the b matrix elements are the product of the b value and unit gradient direction vector (column vector) multiplied by the transpose of the unit gradient direction vector. Therefore, for a given gradient direction, the unit gradient direction vector coordinates are the first column of the 3x3 unitary matrix from a singular value decomposition of its b matrix, while the b value is the trace of its b matrix.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrdConverter_wiki.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:DicomToNrrdConverter_wiki.png&amp;diff=19375</id>
		<title>File:DicomToNrrdConverter wiki.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:DicomToNrrdConverter_wiki.png&amp;diff=19375"/>
		<updated>2011-03-14T20:27:01Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19374</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19374"/>
		<updated>2011-03-14T20:15:42Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Command Line Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the '''smallGradientThreshold''' flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient vectors whose magnitudes were unusually small in Siemens Trio Tim B13 data due to incorrect metadata for diffusion gradient vector coordinate entries in the DICOM header public element tags.&lt;br /&gt;
&lt;br /&gt;
'''For Siemens data:''' In event of incorrect metadata for diffusion gradient vector coordinates in the DICOM header public element tags, please set the '''useBMatrixGradientDirections''' flag. When the useBMatrixGradientDirections flag is set, gradient direction coordinates and b values are derived from the '''bMatrix''' DICOM header private element tag for each gradient. In Siemens DWI data, the b matrix elements are the product of the b value and unit gradient direction vector (column vector) multiplied by the transpose of the unit gradient direction vector. Therefore, for a given gradient direction, the unit gradient direction vector coordinates are the first column of the 3x3 unitary matrix from a singular value decomposition of its b matrix, while the b value is the trace of its b matrix.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19373</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19373"/>
		<updated>2011-03-14T20:12:45Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Command Line Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the '''smallGradientThreshold''' flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient vectors whose magnitudes were unusually small in Siemens Trio Tim B13 data due to incorrect metadata for diffusion gradient vector coordinate entries in the DICOM header public element tags.&lt;br /&gt;
&lt;br /&gt;
'''For Siemens data:''' In event of incorrect metadata for diffusion gradient vector coordinates in the DICOM header public element tags, please set the '''useBMatrixGradientDirections''' flag. When the useBMatrixGradientDirections flag is set, gradient direction coordinates and b values are derived from the '''bMatrix''' DICOM header private element tag for each gradient. In Siemens DWI data, the b matrix elements are the product of the b value and unit gradient direction vector (column vector) multiplied by the transpose of the unit gradient direction vector. Therefore, for a given gradient direction, the unit gradient direction vector coordinates are the first column of the unitary matrix from a singular value decomposition of its b matrix, while the b value is the trace of its b matrix.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19372</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19372"/>
		<updated>2011-03-14T20:04:38Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Command Line Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the '''smallGradientThreshold''' flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient vectors whose magnitudes were unusually small in Siemens Trio Tim B13 data due to incorrect metadata for diffusion gradient vector coordinate entries in the DICOM header public element tags.&lt;br /&gt;
&lt;br /&gt;
In event of incorrect metadata for diffusion gradient vector coordinate entries in the DICOM header public element tags in '''Siemens data''', please set the '''useBMatrixGradientDirections''' flag. When the useBMatrixGradientDirections flag is set, gradient direction coordinates and b values are derived from the bMatrix DICOM header private element tag for each gradient. In Siemens DWI data, the b matrix elements are the product of the b value and unit gradient direction (column vector) multiplied by its transpose. Therefore, the gradient direction coordinates and b value of a gradient can be derived from the b matrix elements via singular value decomposition.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19371</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19371"/>
		<updated>2011-03-14T19:48:42Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Command Line Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the smallGradientThreshold flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient vectors whose magnitudes were unusually small in Siemens Trio Tim B13 data due to incorrect metadata diffusion gradient vector coordinate entries in the DICOM header public element tags.&lt;br /&gt;
&lt;br /&gt;
In event of incorrect metadata diffusion gradient vector coordinate entries in the DICOM header public element tags for Siemens data, please set the useBMatrixGradientDirections flag.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19370</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19370"/>
		<updated>2011-03-14T19:44:32Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Command Line Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
The module is currently set to quit and alert the user of gradients whose magnitudes are unreasonably small (greater than 0 and less than the smallGradientThreshold) via the smallGradientThreshold flag (default value for smallGradientThreshold: 0.2). This flag was created after encountering gradient&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19369</id>
		<title>Modules:DicomToNRRD-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:DicomToNRRD-3.6&amp;diff=19369"/>
		<updated>2011-03-14T19:31:48Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Source Code and Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
DWI Dicom To NRRD&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DWIDicomToNrrdGUI.png|thumb|280px|Screenshot of the UI]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: Command line module&lt;br /&gt;
&lt;br /&gt;
Category: Converters&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Author: Xiaodong Tao (with contribution from Vince Magnotta and Hans Johnson)&lt;br /&gt;
* Contact: taox @ research.ge.com&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
This module converts diffusion weighted MR images in dicom series into Nrrd&lt;br /&gt;
format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
a limited subset of DTI dicom formats available from Siemens, GE,&lt;br /&gt;
and Phillips scanners. Work in progress to support dicom multi-frame&lt;br /&gt;
data. The program parses dicom header to extract necessary&lt;br /&gt;
information about measurement frame, diffusion weighting directions,&lt;br /&gt;
b-values, etc, and write out a nrrd image.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module is typically used as the first step in diffusion weighted image analysis and tractography to convert diffusion weighted images in Dicom format into Nrrd format, which is recognized by Slicer3 as a legitimate diffusion weighted volume. &lt;br /&gt;
&lt;br /&gt;
In the recent development, it is extended to act as a dicom series to nrrd file converted for non-diffusion-weighted images as well.&lt;br /&gt;
&lt;br /&gt;
====Supported DWI formats====&lt;br /&gt;
*Philips scanner/software version combinations:&lt;br /&gt;
**Achieva 2.1.3.6&lt;br /&gt;
**Achieva 2.5.3.0&lt;br /&gt;
**Achieva 2.5.3.3&lt;br /&gt;
**Achieva 2.6.1.0&lt;br /&gt;
**Acheiva 2.6.3.4&lt;br /&gt;
**Intera 2.1.3.6&lt;br /&gt;
**Intera 2.6.3.5&lt;br /&gt;
*Siemens&lt;br /&gt;
**Trio B13&lt;br /&gt;
**Trio B15&lt;br /&gt;
**Trio B17&lt;br /&gt;
**Verio B15V&lt;br /&gt;
*GE&lt;br /&gt;
**SIGNA HDx14.0&lt;br /&gt;
**SIGNA HDxt 15.0&lt;br /&gt;
**DVMR 20.0M4&lt;br /&gt;
**DVMR 20.1&lt;br /&gt;
&lt;br /&gt;
====Command Line Usage====&lt;br /&gt;
A command line example for running the module is:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe --inputDicomDirectory MyDicomDir --outputVolume MyNrrdImage.nhdr&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
[[Image:DicomToNrrd-IOPanels-3-6.png|thumb|right|280px|Input/Output panels]]&lt;br /&gt;
When this module is run from Slicer UI, simply select the directories for '''Input Dicom Data''' and '''Output Directory''', enter the filename (without path name, but '''with''' extension, such as '''mydti.nrrd''') in the '''Output Filename''' field, and press &amp;quot;Apply&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
The module can also be run from command line to enable batch process. An example command line look like:&lt;br /&gt;
&lt;br /&gt;
 d:\Builds\Slicer3\lib\Slicer3\Plugins\Release\DicomToNrrdConverter.exe &lt;br /&gt;
   --inputDicomDirectory MyDicomDir &lt;br /&gt;
   --outputDirectory /scratch/Diffusion&lt;br /&gt;
   --outputVolume MyNrrdImage.nrrd&lt;br /&gt;
&lt;br /&gt;
== Development==&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
This module depends only on the core &amp;quot;Volumes&amp;quot; module of slice for data IO.&lt;br /&gt;
&lt;br /&gt;
===Known Bugs===&lt;br /&gt;
&lt;br /&gt;
===Usability Issues===&lt;br /&gt;
&lt;br /&gt;
Because different vendors used different private tags to store information related to diffusion weighting and documentation on how to interoperate this information is scarce, the current version support diffusion weighted images from GE, Siemens, and Philips scanners. For Siemens, both mosaic and split formats are supported. For Philips, both multi-slice and signal-slice formats are supported. &lt;br /&gt;
&lt;br /&gt;
The current version also support non-diffusion weighted images from any vendors (that GDCM supports), in which case, the module acts as a dicom series to nrrd volume converter.&lt;br /&gt;
&lt;br /&gt;
===Source Code and Documentation===&lt;br /&gt;
&lt;br /&gt;
Source Code: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.cxx?view=markup  DicomToNrrdConverter.cxx]&lt;br /&gt;
&lt;br /&gt;
XML Description: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/DicomToNrrdConverter.xml?view=markup  DicomToNrrdConverter.xml]&lt;br /&gt;
&lt;br /&gt;
Test: [http://viewvc.na-mic.org/viewcvs.cgi/trunk/Applications/CLI/DicomToNrrdConverter/Testing/DicomToNrrdConverterTest.cxx?rev=12979&amp;amp;view=log  DicomToNrrdConverterTest.cxx]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./lib/Slicer3/Plugins/DicomToNrrdConverter --help&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./lib/Slicer3/Plugins/DicomToNrrdConverter  [--returnparameterfile&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--processinformationaddress&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--xml] [--echo]&lt;br /&gt;
                                        [--useIdentityMeaseurementFrame]&lt;br /&gt;
                                        [--writeProtocolGradientsFile]&lt;br /&gt;
                                        [--outputVolume &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--outputDirectory &amp;lt;std::string&amp;gt;]&lt;br /&gt;
                                        [--inputDicomDirectory&lt;br /&gt;
                                        &amp;lt;std::string&amp;gt;] [--] [--version]&lt;br /&gt;
                                        [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --returnparameterfile &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Filename in which to write simple return parameters (int, float,&lt;br /&gt;
     int-vector, etc.) as opposed to bulk return parameters (image,&lt;br /&gt;
     geometry, transform, measurement, table).&lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --useBMatrixGradientDirections&lt;br /&gt;
     Fill the nhdr header with the gradient directions and bvalues computed&lt;br /&gt;
     out of the BMatrix. Only changes behavior for Siemens data. (default:&lt;br /&gt;
     0)&lt;br /&gt;
&lt;br /&gt;
   --useIdentityMeaseurementFrame&lt;br /&gt;
     Adjust all the gradients so that the measurement frame is an identity&lt;br /&gt;
     matrix. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --writeProtocolGradientsFile&lt;br /&gt;
     Write the protocol gradients to a file suffixed by '.txt' as they were&lt;br /&gt;
     specified in the procol by multiplying each diffusion gradient&lt;br /&gt;
     direction by the measurement frame.  This file is for debugging&lt;br /&gt;
     purposes only, the format is not fixed, and will likely change as&lt;br /&gt;
     debugging of new dicom formats is necessary. (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --smallGradientThreshold &amp;lt;double&amp;gt;&lt;br /&gt;
     If a gradient magnitude is greater than 0 and less than&lt;br /&gt;
     smallGradientThreshold, then DicomToNrrdConverter will display an&lt;br /&gt;
     error message and quit, unless the useBMatrixGradientDirections option&lt;br /&gt;
     is set. (default: 0.2)&lt;br /&gt;
&lt;br /&gt;
   --outputVolume &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Output filename (.nhdr)&lt;br /&gt;
&lt;br /&gt;
   --outputDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding the output NRRD format&lt;br /&gt;
&lt;br /&gt;
   --inputDicomDirectory &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Directory holding Dicom series&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Description: Converts diffusion weighted MR images in dicom series into&lt;br /&gt;
   Nrrd format for analysis in Slicer. This program has been tested on only&lt;br /&gt;
   a limited subset of DTI dicom formats available from Siemens, GE, and&lt;br /&gt;
   Phillips scanners. Work in progress to support dicom multi-frame data.&lt;br /&gt;
   The program parses dicom header to extract necessary information about&lt;br /&gt;
   measurement frame, diffusion weighting directions, b-values, etc, and&lt;br /&gt;
   write out a nrrd image. For non-diffusion weighted dicom images, it&lt;br /&gt;
   loads in an entire dicom series and writes out a single dicom volume in&lt;br /&gt;
   a .nhdr/.raw pair.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Xiaodong Tao&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This work is part of the National Alliance for Medical&lt;br /&gt;
   Image Computing (NAMIC), funded by the National Institutes of Health&lt;br /&gt;
   through the NIH Roadmap for Medical Research, Grant U54 EB005149. &lt;br /&gt;
   Additional support for DTI data produced on Philips scanners was&lt;br /&gt;
   contributed by Vincent Magnotta and Hans Johnson at the University of&lt;br /&gt;
   Iowa.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
===Acknowledgement===&lt;br /&gt;
&lt;br /&gt;
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
More information on Dicom format for diffusion weighted images on [http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:DICOM_for_DWI_and_DTI NA-MIC Wiki.]&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18898</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18898"/>
		<updated>2011-01-13T20:51:53Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Use Cases, Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
|Program description || Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume. Described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 1: Same Subject: Longitudinal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a baseline T1 scan with a follow-up T1 scan on the same subject a year later.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT1Longitudinal.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject and very little has likely changed in the last year we'll use a Rigid registration.  If the registration is poor or there are reasons to expect anatomical changes then additional transforms may be needed, in which case they can be added in a comma separated list, such as &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help registration.  If there are lesions or tumors that vary between images this may not be a good idea, as it will make it harder to detect differences between the images.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:LongitudinalCheckerboardPreReg.png|thumb|180px|Longitudinal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:LogitudinalCheckerboardPostReg.png|thumb|180px|Longitudinal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 2: Same Subject: MultiModal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a T1 scan with a T2 scan collected in the same sesson.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT2.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject, same session we'll use a Rigid registration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles as this would try to map the T2 intensities into T1 intensities, resulting in an image that was neither, and hence useless.&lt;br /&gt;
&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:T1T2PreRegCheckerboard.png|thumb|180px|Multimodal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:T1T2RegCheckerboard.png|thumb|180px|Multimodal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 3: Mouse Registration'''''&lt;br /&gt;
&lt;br /&gt;
Here we'll register brains from two different mice together.  The fixed and moving mouse brains used in this example are available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory. &lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the subjects are different we are going to use transforms all the way through BSpline. Again, building up transforms one type at a time can't hurt and might help, so we're including all transforms from Rigid through BSpline in the transformType parameter.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode but we are't working with human heads so we can't pick useCenterOfHeadAlign. Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value for mice is 0.9.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:MouseCheckerboardPreRegistration.png|thumb|180px|Mouse Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:MouseCheckerboardPostRegistration.png|thumb|180px|Mouse Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [http://svn.slicer.org/Slicer4/trunk/Scripts/SEMToMediaWiki.py python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use'''''&amp;lt;/span&amp;gt;: Parameters that define which registration steps to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;] : Determine how to initialize the transform center.  GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsAlign assumes that the center of mass of the images represent similar structures.  useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag. ''Default value: Off''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleSkewVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform an Affine registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a BSpline registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: float''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence ''Default value: 1500''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. ''Default value: 100000''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepLength&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete. ''Default value: 0.005''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern. ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed.  ''Default value: 14,10,12''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer. ''Default value: 0.0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters,  ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or RigidInPlace.  The RigidInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. ''Default value: Linear''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform. ''Default value: NOMASK''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions. ''Default value: 0,0,0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. Do NOT use if registering images from different modailties. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : The number of histogram levels ''Default value: 50''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points ''Default value: 10''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline. ''Default value: ON''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job. ''Default value: AUTO''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Closing Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoClosingSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the hole closing size in mm.  It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm.  For mouse data this value may need to be reset to 0.9 or smaller. ''Default value: 9.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.5''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepLength&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.2''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging. ''Default value: 0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.=&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Cost Metric'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--costMetric&amp;lt;/span&amp;gt;] : The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images) ''Default value: MMI''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://hdl.handle.net/1926/1291 BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit], Johnson H.J., Harris G., Williams K., The Insight Journal, 2007.&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18897</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18897"/>
		<updated>2011-01-13T20:50:31Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Use Cases, Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
|Program description || Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume. Described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 1: Same Subject: Longitudinal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a baseline T1 scan with a follow-up T1 scan on the same subject a year later.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT1Longitudinal.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject and very little has likely changed in the last year we'll use a Rigid registration.  If the registration is poor or there are reasons to expect anatomical changes then additional transforms may be needed, in which case they can be added in a comma separated list, such as &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help registration.  If there are lesions or tumors that vary between images this may not be a good idea, as it will make it harder to detect differences between the images.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:LongitudinalCheckerboardPreReg.png|thumb|180px|Longitudinal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:LogitudinalCheckerboardPostReg.png|thumb|180px|Longitudinal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 2: Same Subject: MultiModal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a T1 scan with a T2 scan collected in the same sesson.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT2.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject, same session we'll use a Rigid registration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles as this would try to map the T2 intensities into T1 intensities, resulting in an image that was neither, and hence useless.&lt;br /&gt;
&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:T1T2PreRegCheckerboard.png|thumb|180px|Multimodal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:T1T2RegCheckerboard.png|thumb|180px|Multimodal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 3: Mouse Registration'''''&lt;br /&gt;
&lt;br /&gt;
Here we'll register brains from two different mice together.  The fixed and moving mouse brains used in this example are available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory. &lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the subjects are different we are going to use transforms all the way through BSpline. Again, building up transforms one type at a time can't hurt and might help, so we're including all transforms from Rigid through BSpline in the transformType parameter.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode but we are't working with human heads so we can't pick useCenterOfHead. Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value for mice is 0.9.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:MouseCheckerboardPreRegistration.png|thumb|180px|Mouse Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:MouseCheckerboardPostRegistration.png|thumb|180px|Mouse Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [http://svn.slicer.org/Slicer4/trunk/Scripts/SEMToMediaWiki.py python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use'''''&amp;lt;/span&amp;gt;: Parameters that define which registration steps to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;] : Determine how to initialize the transform center.  GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsAlign assumes that the center of mass of the images represent similar structures.  useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag. ''Default value: Off''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleSkewVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform an Affine registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a BSpline registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: float''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence ''Default value: 1500''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. ''Default value: 100000''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepLength&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete. ''Default value: 0.005''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern. ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed.  ''Default value: 14,10,12''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer. ''Default value: 0.0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters,  ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or RigidInPlace.  The RigidInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. ''Default value: Linear''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform. ''Default value: NOMASK''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions. ''Default value: 0,0,0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. Do NOT use if registering images from different modailties. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : The number of histogram levels ''Default value: 50''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points ''Default value: 10''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline. ''Default value: ON''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job. ''Default value: AUTO''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Closing Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoClosingSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the hole closing size in mm.  It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm.  For mouse data this value may need to be reset to 0.9 or smaller. ''Default value: 9.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.5''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepLength&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.2''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging. ''Default value: 0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.=&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Cost Metric'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--costMetric&amp;lt;/span&amp;gt;] : The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images) ''Default value: MMI''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://hdl.handle.net/1926/1291 BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit], Johnson H.J., Harris G., Williams K., The Insight Journal, 2007.&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18896</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18896"/>
		<updated>2011-01-13T20:06:52Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Use Cases, Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
|Program description || Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume. Described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 1: Same Subject: Longitudinal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a baseline T1 scan with a follow-up T1 scan on the same subject a year later.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT1Longitudinal.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject and very little has likely changed in the last year we'll use a Rigid registration.  If the registration is poor or there are reasons to expect anatomical changes then additional transforms may be needed, in which case they can be added in a comma separated list, such as &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help registration.  If there are lesions or tumors that vary between images this may not be a good idea, as it will make it harder to detect differences between the images.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHead, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHead \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useCenterOfHead \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:LongitudinalCheckerboardPreReg.png|thumb|180px|Longitudinal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:LogitudinalCheckerboardPostReg.png|thumb|180px|Longitudinal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 2: Same Subject: MultiModal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a T1 scan with a T2 scan collected in the same sesson.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT2.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject, same session we'll use a Rigid registration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles as this would try to map the T2 intensities into T1 intensities, resulting in an image that was neither, and hence useless.&lt;br /&gt;
&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is very clear.  The parameter that expands the mask outside the brain is ROIAutoDilateSize (under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:T1T2PreRegCheckerboard.png|thumb|180px|Multimodal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:T1T2RegCheckerboard.png|thumb|180px|Multimodal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 3: Mouse Registration'''''&lt;br /&gt;
&lt;br /&gt;
Here we'll register brains from two different mice together.  The fixed and moving mouse brains used in this example are available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory. &lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the subjects are different we are going to use transforms all the way through BSpline. Again, building up transforms one type at a time can't hurt and might help, so we're including all transforms from Rigid through BSpline in the transformType parameter.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode but we are't working with human heads so we can't pick useCenterOfHead. Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI).  These values are in millimeters so a good starting value for mice is 0.9.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed.  If the best possible interpolation is needed regardless of processing time, select WindowedSync instead of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:MouseCheckerboardPreRegistration.png|thumb|180px|Mouse Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:MouseCheckerboardPostRegistration.png|thumb|180px|Mouse Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [http://svn.slicer.org/Slicer4/trunk/Scripts/SEMToMediaWiki.py python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use'''''&amp;lt;/span&amp;gt;: Parameters that define which registration steps to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;] : Determine how to initialize the transform center.  GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsAlign assumes that the center of mass of the images represent similar structures.  useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag. ''Default value: Off''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleSkewVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform an Affine registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a BSpline registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: float''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence ''Default value: 1500''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. ''Default value: 100000''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepLength&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete. ''Default value: 0.005''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern. ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed.  ''Default value: 14,10,12''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer. ''Default value: 0.0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters,  ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or RigidInPlace.  The RigidInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. ''Default value: Linear''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform. ''Default value: NOMASK''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions. ''Default value: 0,0,0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. Do NOT use if registering images from different modailties. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : The number of histogram levels ''Default value: 50''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points ''Default value: 10''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline. ''Default value: ON''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job. ''Default value: AUTO''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Closing Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoClosingSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the hole closing size in mm.  It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm.  For mouse data this value may need to be reset to 0.9 or smaller. ''Default value: 9.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.5''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepLength&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.2''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging. ''Default value: 0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.=&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Cost Metric'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--costMetric&amp;lt;/span&amp;gt;] : The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images) ''Default value: MMI''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [http://hdl.handle.net/1926/1291 BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit], Johnson H.J., Harris G., Williams K., The Insight Journal, 2007.&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18741</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18741"/>
		<updated>2010-12-21T06:20:03Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image that is deformed. The B-Spline registration works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomy''' performs this registration step and a detailed list of parameters can be found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created using the gtractInvertBspline. The X, Y and Z grids specify the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susceptibility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and nearest neighbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines the Tensor at each point along the fiber tract. This can then be used to be rendered as glyphs in Slicer3 and can be used to define several scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anisotropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]) for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambiguous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anisotropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] uses this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and speed image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18740</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18740"/>
		<updated>2010-12-21T06:06:45Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Fiber Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image that is deformed. The B-Spline registration works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can be found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created using the gtractInvertBspline. The X, Y and Z grids specify the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susceptibility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and nearest neighbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines the Tensor at each point along the fiber tract. This can then be used to be rendered as glyphs in Slicer3 and can be used to define several scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anisotropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]) for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambiguous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anisotropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] uses this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and speed image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18739</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18739"/>
		<updated>2010-12-21T05:51:40Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image that is deformed. The B-Spline registration works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can be found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created using the gtractInvertBspline. The X, Y and Z grids specify the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susceptibility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and nearest neighbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18738</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18738"/>
		<updated>2010-12-21T05:50:30Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Invert B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image that is deformed. The B-Spline registration works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can be found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created using the gtractInvertBspline. The X, Y and Z grids specify the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susceptibility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18737</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18737"/>
		<updated>2010-12-21T05:48:02Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image that is deformed. The B-Spline registration works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can be found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18736</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18736"/>
		<updated>2010-12-21T05:47:01Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical Rigid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here is the complete set of parameters for [[gtractCoRegAnatomy]].&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18735</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18735"/>
		<updated>2010-12-21T05:46:12Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Copy Reference Image Orientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguments for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18734</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18734"/>
		<updated>2010-12-21T05:45:17Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Compute Anisotropy Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anisotropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anisotropy (FA)&lt;br /&gt;
* Relative Anisotropy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18733</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18733"/>
		<updated>2010-12-21T05:43:54Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* DTI Image Co-Registration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-registration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjust the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18732</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18732"/>
		<updated>2010-12-21T05:37:41Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* GTRACT Programs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18731</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18731"/>
		<updated>2010-12-21T05:21:13Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* DTI Image Co-Registration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is [[gtractCoregBvalues]]. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18730</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18730"/>
		<updated>2010-12-21T05:16:59Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Guided Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract guide.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18729</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18729"/>
		<updated>2010-12-21T05:13:37Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Guided Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractFiberTracking]] his algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume --startingSeed.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume --endingSeed.nhdr \&lt;br /&gt;
  --endingSeedsLable 2 \&lt;br /&gt;
  --inputTract inputTract.vtk \&lt;br /&gt;
  --trackingMethod Guided \&lt;br /&gt;
  --guidedCurvatureThreshold 30.0 \&lt;br /&gt;
  --maximumGuideDistance 12.0 \&lt;br /&gt;
  --outputTract guidedTrack.vtk&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18728</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18728"/>
		<updated>2010-12-21T01:06:20Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Graph Search Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18727</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18727"/>
		<updated>2010-12-21T01:05:53Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Graph Search Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18726</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18726"/>
		<updated>2010-12-21T01:04:45Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Guided Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18725</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18725"/>
		<updated>2010-12-21T01:03:05Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Free Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --trackingMethod Free \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18724</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18724"/>
		<updated>2010-12-21T01:02:47Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Free Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18723</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18723"/>
		<updated>2010-12-21T01:02:35Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Streamline Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFiberTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18722</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18722"/>
		<updated>2010-12-21T01:02:15Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Streamline Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --trackingMethod Streamline \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18721</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18721"/>
		<updated>2010-12-21T01:01:35Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Graph Search Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
  --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
  --trackingMethod GraphSearch \&lt;br /&gt;
  --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
  --startingSeedsLabel 1 \&lt;br /&gt;
  --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
  --endingSeedsLabel 2 \&lt;br /&gt;
  --inputTract guideFiber.vtk \&lt;br /&gt;
  --curvatureThreshold 60 \&lt;br /&gt;
  --branchingThreshold 0.20 \&lt;br /&gt;
  --maximumBranchPoints 5 \&lt;br /&gt;
  --branchingAngle 45.0 \&lt;br /&gt;
  --outputTract graphSearchTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18720</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18720"/>
		<updated>2010-12-21T00:58:18Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Streamline Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18719</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18719"/>
		<updated>2010-12-21T00:56:42Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18718</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18718"/>
		<updated>2010-12-21T00:55:53Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Streamline Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA_map.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
   --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
   --inputStartingSeedsLabelMapVolume startingSeedsLabelMap.nhdr \&lt;br /&gt;
   --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
   --inputEndingSeedsLabelMapVolume endingSeedsLabelMap.nhdr \&lt;br /&gt;
   --endingSeedsLabel 2 \&lt;br /&gt;
   --curvatureThreshold 60 \&lt;br /&gt;
   --outputTract streamlineTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18717</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18717"/>
		<updated>2010-12-21T00:36:19Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume B0_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleAnisotropy --inputAnisotropyVolume FA_map.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.txt --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume FA_ACPC_rigid.nii.gz&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18716</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18716"/>
		<updated>2010-12-21T00:27:09Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleB0 --inputVolume DWI_Coreg.nhdr --inputAnatomicalVolume T1_ACPC.nhdr \&lt;br /&gt;
    --inputTransform ACPC_Rigid.xfm --vectorIndex 0 \&lt;br /&gt;
    --transformType Rigid --outputVolume Resampled_B0.nhdr&lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18715</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18715"/>
		<updated>2010-12-21T00:23:14Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Examples:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18714</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18714"/>
		<updated>2010-12-21T00:22:10Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Resampling Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm \&lt;br /&gt;
    --transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18713</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18713"/>
		<updated>2010-12-21T00:21:29Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Invert B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform --inputReferenceVolume T1_ACPC.nhdr --inputTransform ACPC_bspline.xfm \&lt;br /&gt;
                              --outputTransform ACPC_Inverse_Bspline.xfm&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GtractInvertBSplineTransform&amp;diff=18712</id>
		<title>GtractInvertBSplineTransform</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GtractInvertBSplineTransform&amp;diff=18712"/>
		<updated>2010-12-21T00:02:35Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: Created page with '===Module Type &amp;amp; Category===  Type: CLI  Category: Diffusion.GTRACT    ===Authors, Collaborators &amp;amp; Contact===  Author: This tool was developed by Vincent Magnotta and Greg Harris…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Diffusion.GTRACT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: This tool was developed by Vincent Magnotta and Greg Harris.&lt;br /&gt;
&lt;br /&gt;
Contributors: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|Program title || B-Spline Transform Inversion&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 4.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Image Files''''' &amp;lt;/span&amp;gt; Parameters for specifying the B-Spline transform and the space to invert it in.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Reference Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputReferenceVolume&amp;lt;/span&amp;gt;] : Required: input image file name to exemplify the anatomical space to interpolate over.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input B-Spline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputTransform&amp;lt;/span&amp;gt;] : Required: input B-Spline transform file name&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Image Files''''' &amp;lt;/span&amp;gt; Output file from conversion from Dicom to Nrrd&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : Required: output transform file name&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Transform Conversion Parameters''''' &amp;lt;/span&amp;gt; Input parameters controlling the approximation of a B-Spline inverse by a thin-plate spline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Landmark Density'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--landmarkDensity&amp;lt;/span&amp;gt;] : Number of landmark subdivisions in all 3 directions&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18711</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18711"/>
		<updated>2010-12-20T23:58:33Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Invert B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifacts.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18710</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18710"/>
		<updated>2010-12-20T23:55:45Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical Rigid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18709</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18709"/>
		<updated>2010-12-20T23:55:14Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical B-Spline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume 0226770_DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume DWI_coreg.nhdr --transformType Bspline \&lt;br /&gt;
     --vectorIndex 0 --inputRigidTransform ACPC_rigid.mat --inputAnatomicalVolume T1_ACPC_Axial.nhdr \&lt;br /&gt;
     --outputTransformName ACPC_bspline.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18708</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18708"/>
		<updated>2010-12-20T23:50:10Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical Rigid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume 0226770_DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputTransformName ACPC_rigid.mat --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18707</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18707"/>
		<updated>2010-12-20T23:30:44Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Anatomical Rigid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomy --inputVolume 0226770_DWI_coreg.nhdr --transformType Rigid \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18703</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18703"/>
		<updated>2010-12-20T22:48:07Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* DTI Image Co-Registration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
  --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18702</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18702"/>
		<updated>2010-12-20T22:47:14Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* DTI Image Co-Registration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0 \&lt;br /&gt;
 % --outputVolume outputImage.nhdr&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GtractFastMarchingTracking&amp;diff=18701</id>
		<title>GtractFastMarchingTracking</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GtractFastMarchingTracking&amp;diff=18701"/>
		<updated>2010-12-20T22:35:21Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: Created page with '===Module Type &amp;amp; Category===  Type: CLI  Category: Diffusion.GTRACT    ===Authors, Collaborators &amp;amp; Contact===  Author: This tool was developed by Vincent Magnotta and Greg Harris…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Diffusion.GTRACT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: This tool was developed by Vincent Magnotta and Greg Harris. The original code here was developed by Daisy Espino.&lt;br /&gt;
&lt;br /&gt;
Contributors: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|Program title || Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 4.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Image Files''''' &amp;lt;/span&amp;gt; Parameters for specifying the diffusion tensor image set&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Tensor Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputTensorVolume&amp;lt;/span&amp;gt;] : Required: input tensor image file name&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Anisotropy Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputAnisotropyVolume&amp;lt;/span&amp;gt;] : Required: input anisotropy image file name&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Cost Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputCostVolume&amp;lt;/span&amp;gt;] : Required: input vcl_cost image file name&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Starting Seeds LabelMap Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputStartingSeedsLabelMapVolume&amp;lt;/span&amp;gt;] : Required: input starting seeds LabelMap image file name&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Starting Seeds Label'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--startingSeedsLabel&amp;lt;/span&amp;gt;] : Label value for Starting Seeds&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Files''''' &amp;lt;/span&amp;gt; Output file in which to store tract lines&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Tract Filename'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTract&amp;lt;/span&amp;gt;] : Required: name of output vtkPolydata file containing tract lines and the point data collected along them.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write fiber tracts in XML format'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeXMLPolyDataFile&amp;lt;/span&amp;gt;] : Flag to make use of the XML format for vtkPolyData fiber tracts.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Fast Marching Tracking Parameters''''' &amp;lt;/span&amp;gt; Input parameters controlling the Fast Marching Cost Function&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : Number of iterations used for the optimization&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Seed Threshold'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--seedThreshold&amp;lt;/span&amp;gt;] : Anisotropy threshold used for seed selection&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Tracking Threshold'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--trackingThreshold&amp;lt;/span&amp;gt;] : Anisotropy threshold used for fiber tracking&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Cost Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--costStepSize&amp;lt;/span&amp;gt;] : Cost image sub-voxel sampling&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Maximum step size to move when tracking&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Minimum step size to move when tracking&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18700</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=18700"/>
		<updated>2010-12-20T22:34:47Z</updated>

		<summary type="html">&lt;p&gt;Matsuij: /* Fast Marching Tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DicomToNrrdConverter --inputDicomDirectory DICOM_directory_name --outputVolume NRRD_file_name.nrrd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
The following are links to the full documentation of GTRACT's programs. The same documentation can be accessed on the command line using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${GTRACT_prog_name} --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomy|gtractCoRegAnatomy Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvalues|gtractCoregBvalues Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0&lt;br /&gt;
&lt;br /&gt;
A complete listing of parameters can be found here, [[gtractCoregBvalues]], or can be obtained on the command line using &lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --help&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomy]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBSplineTransform]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# Free Tracking&lt;br /&gt;
# Streamlines Tracking&lt;br /&gt;
# Graph Search Tracking&lt;br /&gt;
# Guided Tracking&lt;br /&gt;
# Fast Marching Tracking&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low anisotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguments for [[gtractFiberTracking]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambiguous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the secondary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline algorithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguments for [[gtractFiberTracking]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractFiberTracking]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractCreateGuideFiber]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractFiberTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Matsuij</name></author>
		
	</entry>
</feed>