<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.na-mic.org/w/index.php?action=history&amp;feed=atom&amp;title=NAMIC_Wiki%3ADTI%3AHelixDWI</id>
	<title>NAMIC Wiki:DTI:HelixDWI - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.na-mic.org/w/index.php?action=history&amp;feed=atom&amp;title=NAMIC_Wiki%3ADTI%3AHelixDWI"/>
	<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=NAMIC_Wiki:DTI:HelixDWI&amp;action=history"/>
	<updated>2026-05-14T11:52:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=NAMIC_Wiki:DTI:HelixDWI&amp;diff=4857&amp;oldid=prev</id>
		<title>Andy: /* Estimating and visualizing tensors */</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=NAMIC_Wiki:DTI:HelixDWI&amp;diff=4857&amp;oldid=prev"/>
		<updated>2006-12-20T15:55:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Estimating and visualizing tensors&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:55, 20 December 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l124&quot; &gt;Line 124:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 124:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Because the camera and glyph parameters are set on the command-line, the following image should come up:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Because the camera and glyph parameters are set on the command-line, the following image should come up:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;div class=&amp;quot;thumb tright&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;width: 182px&amp;quot;&amp;gt;&lt;/del&gt;[[Image:000000.png|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[Image:&lt;/del&gt;180px&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-000000.png&lt;/del&gt;|Glyphs for synthetic helical DWI dataset]]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]]&amp;lt;div class=&amp;quot;thumbcaption&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;magnify&amp;quot; style=&amp;quot;float: right&amp;quot;&amp;gt;[[Image:000000.png|[[Image:magnify-clip.png|Enlarge]]]]&amp;lt;/div&amp;gt;Glyphs for synthetic helical DWI dataset&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Image:000000.png|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;thumb|right|&lt;/ins&gt;180px|Glyphs for synthetic helical DWI dataset]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following things should be noted:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following things should be noted:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andy</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=NAMIC_Wiki:DTI:HelixDWI&amp;diff=4189&amp;oldid=prev</id>
		<title>Andy: Update from Wiki</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=NAMIC_Wiki:DTI:HelixDWI&amp;diff=4189&amp;oldid=prev"/>
		<updated>2006-12-18T13:37:41Z</updated>

		<summary type="html">&lt;p&gt;Update from Wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page shows how to use Teem command-line tools to create a synthetic DWI dataset in NRRD format, which can be used to verify a given piece of software's handling of the coordinate frames involved, especially the measurement frame.&lt;br /&gt;
&lt;br /&gt;
Running these commands requires a version of Teem more recent than version 1.9.0, the version shipping with Slicer 2.6. However, the datasets can be downloaded from here without regenerating them.&lt;br /&gt;
&lt;br /&gt;
=== Creating the gradient list ===&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 tend grads -n 12 \&lt;br /&gt;
  | unu pad -min 0 -1 -max M M -b pad -v 0 -o grads.txt&lt;br /&gt;
&lt;br /&gt;
This generates a set of gradient directions, pre-pended with a zero vector (for a baseline image). The result should be the text file &amp;quot;&amp;lt;tt&amp;gt;grads.txt&amp;lt;/tt&amp;gt;&amp;quot; with contents:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 0 0 0&lt;br /&gt;
 0.045864213 -0.97327703 -0.22500728&lt;br /&gt;
 0.25820592 -0.47978204 0.83853376&lt;br /&gt;
 -0.40941855 -0.2207699 0.88523281&lt;br /&gt;
 0.90057635 -0.041144647 -0.43274629&lt;br /&gt;
 0.9589954 -0.024969423 0.28231958&lt;br /&gt;
 -0.53121203 -0.12678577 -0.8376987&lt;br /&gt;
 -0.75857437 -0.61072785 0.22710435&lt;br /&gt;
 -0.65501362 0.7005415 -0.28319383&lt;br /&gt;
 0.56272566 0.69972253 0.44014561&lt;br /&gt;
 0.10537088 -0.45475256 -0.88436252&lt;br /&gt;
 -0.62760335 0.64766514 0.43202299&lt;br /&gt;
 0.15000534 0.88426256 -0.44224218&lt;br /&gt;
&lt;br /&gt;
=== Creating the synthetic tensor field ===&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 tend helix -s 29 30 31 -ip 0.1 0.3 0.6 -mp -0.8 0.1 0.4 -r 40 -o ten.nrrd&lt;br /&gt;
&lt;br /&gt;
This program generates a tensor field where the anisotropy tensors are along a right-handed helix, with the tensors themselves displaying a particular kind of twist.&lt;br /&gt;
&lt;br /&gt;
To make things interesting, the image orientation and measurement frames are set to something non-axis-aligned, via the &amp;quot;&amp;lt;tt&amp;gt;-ip 0.1 0.3 0.6&amp;lt;/tt&amp;gt;&amp;quot; and &amp;quot;&amp;lt;tt&amp;gt;-mp -0.8 0.1 0.4&amp;lt;/tt&amp;gt;&amp;quot; options respectively, and these determine the &amp;quot;&amp;lt;tt&amp;gt;space directions&amp;lt;/tt&amp;gt;&amp;quot; and &amp;quot;&amp;lt;tt&amp;gt;measurement frame&amp;lt;/tt&amp;gt;&amp;quot; fields. They can be inspected via:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 unu head ten.nrrd&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 NRRD0005&lt;br /&gt;
 # Complete NRRD file format specification at:&lt;br /&gt;
 # http://teem.sourceforge.net/nrrd/format.html&lt;br /&gt;
 type: float&lt;br /&gt;
 dimension: 4&lt;br /&gt;
 space: right-anterior-superior&lt;br /&gt;
 sizes: 7 29 30 31&lt;br /&gt;
 space directions: none (2.645253,5.951819,-2.267359) (-5.205479,3.287671,2.557078) (3.181617,0.707026,5.56783)&lt;br /&gt;
 centerings: ??? cell cell cell&lt;br /&gt;
 kinds: 3D-masked-symmetric-matrix space space space&lt;br /&gt;
 endian: big&lt;br /&gt;
 encoding: raw&lt;br /&gt;
 space origin: (-9.278346,-141.602085,-88.852048)&lt;br /&gt;
 measurement frame: (0.812155,0.353591,-0.464088) (-0.530387,0.116022,-0.839779) (-0.243094,0.928177,0.281768)&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the synthetic DWI data (.nhdr and .raw available) ===&lt;br /&gt;
&lt;br /&gt;
First we have to invent a baseline T2 image:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 tend helix -s 29 30 31 -ip 0.1 0.3 0.6 -mp -0.8 0.1 0.4 -r 50 \&lt;br /&gt;
  | tend anvol -a fa \&lt;br /&gt;
  | unu 2op x - 7000 -o b0.nrrd&lt;br /&gt;
&lt;br /&gt;
This is a little silly- its just making a new tensor volume with a fatter radius (&amp;quot;-r 50&amp;quot; instead of &amp;quot;-r 40&amp;quot;), then measuring fractional anisotropy everywhere, multiplying it by 7000, then saving it out to a scalar nrrd volume.&lt;br /&gt;
&lt;br /&gt;
Then, the DWI value simulation is done based on the baseline image and synthetic tensors:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 tend sim -g grads.txt -r b0.nrrd -i ten.nrrd \&lt;br /&gt;
   -b 800 -t ushort -kvp -o dwi-D.nhdr&lt;br /&gt;
&lt;br /&gt;
This results in a NRRD DWI header of the same form that is created for measured DWI scans:&lt;br /&gt;
&lt;br /&gt;
* [[Image:Dwi-D.nhdr|Image:Dwi-D.nhdr]]&amp;lt;nowiki&amp;gt;: the detached NRRD header &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* [[Image:Dwi-D.raw|Image:Dwi-D.raw]]&amp;lt;nowiki&amp;gt;: the single raw file (same directory as .nhdr file) &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 NRRD0005&lt;br /&gt;
 # Complete NRRD file format specification at:&lt;br /&gt;
 # http://teem.sourceforge.net/nrrd/format.html&lt;br /&gt;
 content: (unsigned short)(???)&lt;br /&gt;
 type: unsigned short&lt;br /&gt;
 dimension: 4&lt;br /&gt;
 space: right-anterior-superior&lt;br /&gt;
 sizes: 13 29 30 31&lt;br /&gt;
 space directions: none (2.645253,5.951819,-2.267359) (-5.205479,3.287671,2.557078) (3.181617,0.707026,5.56783)&lt;br /&gt;
 centerings: ??? cell cell cell&lt;br /&gt;
 kinds: list space space space&lt;br /&gt;
 endian: big&lt;br /&gt;
 encoding: raw&lt;br /&gt;
 space origin: (-9.278346,-141.602085,-88.852048)&lt;br /&gt;
 measurement frame: (0.812155,0.353591,-0.464088) (-0.530387,0.116022,-0.839779) (-0.243094,0.928177,0.281768)&lt;br /&gt;
 data file: dwi-D.raw&lt;br /&gt;
 modality:=DWMRI&lt;br /&gt;
 DWMRI_b-value:=800&lt;br /&gt;
 DWMRI_gradient_0000:=0 0 0&lt;br /&gt;
 DWMRI_gradient_0001:=0.0458642 -0.973277 -0.225007&lt;br /&gt;
 DWMRI_gradient_0002:=0.258206 -0.479782 0.838534&lt;br /&gt;
 DWMRI_gradient_0003:=-0.409419 -0.22077 0.885233&lt;br /&gt;
 DWMRI_gradient_0004:=0.900576 -0.0411446 -0.432746&lt;br /&gt;
 DWMRI_gradient_0005:=0.958995 -0.0249694 0.28232&lt;br /&gt;
 DWMRI_gradient_0006:=-0.531212 -0.126786 -0.837699&lt;br /&gt;
 DWMRI_gradient_0007:=-0.758574 -0.610728 0.227104&lt;br /&gt;
 DWMRI_gradient_0008:=-0.655014 0.700541 -0.283194&lt;br /&gt;
 DWMRI_gradient_0009:=0.562726 0.699723 0.440146&lt;br /&gt;
 DWMRI_gradient_0010:=0.105371 -0.454753 -0.884363&lt;br /&gt;
 DWMRI_gradient_0011:=-0.627603 0.647665 0.432023&lt;br /&gt;
 DWMRI_gradient_0012:=0.150005 0.884263 -0.442242&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Estimating and visualizing tensors ===&lt;br /&gt;
&lt;br /&gt;
This uses &amp;quot;&amp;lt;tt&amp;gt;tend estim&amp;lt;/tt&amp;gt;&amp;quot; to estimate tensors with linear-least-squares on the log(DWI), and then passes them to the Deft program for visualization:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 tend estim -i dwi-D.nhdr -knownB0 false -B kvp -o - \&lt;br /&gt;
  | Deft_dti -i - -a fa -gsc 1200 -atr 0.65 \&lt;br /&gt;
   -fr 940.805 307.575 1025.14 -at 0 0 0 \&lt;br /&gt;
   -up -0.521774 -0.557152 0.646014 -rh -ar \&lt;br /&gt;
   -dn -164.709 -df 164.709 -fv 5.41056 -is 640 480&lt;br /&gt;
&lt;br /&gt;
Because the camera and glyph parameters are set on the command-line, the following image should come up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;thumb tright&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;width: 182px&amp;quot;&amp;gt;[[Image:000000.png|[[Image:180px-000000.png|Glyphs for synthetic helical DWI dataset]]]]&amp;lt;div class=&amp;quot;thumbcaption&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;magnify&amp;quot; style=&amp;quot;float: right&amp;quot;&amp;gt;[[Image:000000.png|[[Image:magnify-clip.png|Enlarge]]]]&amp;lt;/div&amp;gt;Glyphs for synthetic helical DWI dataset&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following things should be noted:&lt;br /&gt;
&lt;br /&gt;
* The region of anisotropy is helical. The spatial axis sizes were all unequal (&amp;quot;&amp;lt;tt&amp;gt;-s 29 30 31&amp;lt;/tt&amp;gt;.&amp;quot;), so if these are interpreted incorrectly (e.g. slow to fast instead of fast to slow), the anisotropic region will not appear as a simple helix.&lt;br /&gt;
* The helix is right-handed, like a DNA strand. As your right hand thumb moves along the axis of the helix, curling your fingers follows the path of the helix. If you see a left-handed helix, the handed-ness of your coordinate system is wrong.&lt;br /&gt;
* Along the surface of the helical path, the glyphs also rotate along a right-handed helix. If the tensors do not have this consistent surface-aligned appearance, there is something wrong with your handling of the measurement frame.&lt;/div&gt;</summary>
		<author><name>Andy</name></author>
		
	</entry>
</feed>