<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Zhuang,
<div><br>
</div>
<div>Sorry, this is my bad - I used the wrong input in the fa command! If you use:</div>
<div><br>
</div>
<div>fa < dt.Bdouble > fa.img</div>
<div><br>
</div>
<div>the problem should be resolved. Also, when running the commands for the coronal/sagittal views, please change the shredder commands (for FA) so that they read/skip in 8 byte chunks. I (wrongly) assumed that you had got sfplot to work with the FA map
as floats. The commands should be</div>
<div><br>
</div>
<div><span style="color: rgb(128, 128, 128); font-family: 'Courier New'; ">shredder $((sliceOffset*112*8)) $((1*112*8)) $((111*112*8)) < fa.img > cor_fa.Bfloat</span>
</div>
<div><span style="color: rgb(128, 128, 128); font-family: 'Courier New'; "><br>
</span></div>
<div><font face="Courier New" color="gray">shredder $((sliceOffset*8)) $((1*8)) $((111*8)) < fa.img > sag_fa.Bfloat</font></div>
<div><br>
</div>
<div>Hope that helps.</div>
<div><br>
</div>
<div>Kiran<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF687225" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> Zhuang Song [zhuang.song@gmail.com]<br>
<b>Sent:</b> 15 August 2012 20:48<br>
<b>To:</b> Seunarine, Kiran<br>
<b>Cc:</b> camino-users@www.nitrc.org; Rowe, Matthew<br>
<b>Subject:</b> Re: [Camino-users] sfplot warning/error<br>
</font><br>
</div>
<div></div>
<div>Hi Kiran and Matt,
<div><br>
</div>
<div>Thank you both for the thoughts and suggestions. To create the FA map, I used the scripts in the online Tutorial for DTI (<a href="http://cmic.cs.ucl.ac.uk/camino//index.php?n=Tutorials.DTI" target="_blank">http://cmic.cs.ucl.ac.uk/camino//index.php?n=Tutorials.DTI</a>): </div>
<div><br>
</div>
<span class="Apple-style-span" style="color: rgb(80, 80, 80); font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 13px; ">
<pre class="escaped" style="margin-top:0px; margin-bottom:0px">for PROG in fa md; do
cat dt.Bdouble | ${PROG} | voxel2image -outputroot ${PROG} -header 4Ddwi_b1000.nii.gz </pre>
</span>
<div><span class="Apple-style-span" style="color:rgb(80,80,80); font-family:monospace; font-size:13px; white-space:pre">done</span></div>
<div><br>
</div>
<div>This script actually generated FA map in NIFTI format. Since I thought fa.img was in ANALYZE format as it looks like, I converted the FA map in NIFTI to ANALYZE format and then did the 'split'. It was due to a confusion of the format of fa.img. This became
clear to me after I ran the command suggest by Kiran: <span class="Apple-style-span" style="color:rgb(128,128,128); font-family:'Courier New'; font-size:13px">fa < dwi.Bfloat > fa.img, because there was no fa.hdr in the output as in the ANALYZE format. </span><br>
<br>
</div>
<div>However there is still a problem with 'split' after using Kiran's script to generate fa.img. By running <span class="Apple-style-span" style="color:rgb(80,80,80); font-family:monospace; font-size:11px">split -b $((112*112*8)) fa.img splitBrain/fa_slice
(for the example human brain data in the tutorial), </span>the total slice number of the FA map become 104, which is supposed to be 50. What would be the problem now?</div>
<div><br>
</div>
<div>Thanks for giving the scripts to display ODF in three views. It doesn't looks straightforward and I will test it carefully later. I will keep you updated. </div>
<div><br>
</div>
<div>Many thanks, </div>
<div>Zhuang </div>
<div><br>
</div>
<div><br>
<div class="gmail_quote">On Tue, Aug 14, 2012 at 8:37 AM, Seunarine, Kiran <span dir="ltr">
<<a href="mailto:k.seunarine@ucl.ac.uk" target="_blank">k.seunarine@ucl.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div style="word-wrap:break-word">
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">Hi Zhuang,<br>
<br>
Sorry for the slow reply. With regard to your first question, what command did you use to create the FA map? The standard command, i.e.<br>
<br>
<span style="color:rgb(128,128,128); font-family:Courier New">fa < dwi.Bfloat > fa.img</span><br>
<br>
should output the FA as big-endian doubles. If you used a different command (for example, you set -outputdatatype or piped the output through voxel2image) then the you have to adjust the data type in the subsequent commands. I will add the DTI commands we
used to the multi-fibre tutorial to avoid any further confusion.<br>
<br>
To create different views in sfplot, you will need to use Camino's shredder utility to extract the correct information. So, to obtain a coronal view, the commands are<br>
<br>
<span style="color:rgb(0,128,0); font-family:Courier New"># coronal image (slice 61) - read 11th row of each axial slice</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">sliceOffset=60</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">shredder $((sliceOffset*112*4)) $((1*112*4)) $((111*112*4)) < fa.img > cor_fa.Bfloat</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">shredder $((sliceOffset*112*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">)) $((1*112*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">))
$((111*112*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">)) <
</span><code style="color:rgb(128,128,128); font-family:Courier New">dwi_ODFs.Bdouble</code><span style="color:rgb(128,128,128); font-family:Courier New"> > cor_</span><code style="color:rgb(128,128,128); font-family:Courier New">dwi_ODFs.Bdouble</code><br style="color:rgb(128,128,128); font-family:Courier New">
<br>
The shredder command above skips the first 60 rows, reads a row, then skips the next 111 rows. This gives you one coronal slice. You can select other slices by adjusting the initial offset.<br>
<br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New"><span style="color:rgb(0,128,0)"># plot as usual, but remember to update -projection so that the ODFs are being viewed from the correct direction!</span></span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">sfplot -inputmodel rbf -rbfpointset 246 -rbfsigma 0.2618 -xsize 50 -ysize 112 -minifigsize 30 30 -minifigseparation 2 2 -minmaxnorm -dircolcode -projection 3 -2 -backdrop cor_fa.Bfloat < cor_dwi_ODFs.Bdouble
> cor_dwi_ODFs.rgb</span><br style="color:rgb(128,128,128); font-family:Courier New">
<br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">convert -depth 8 -size 3584x1600 cor_dwi_ODFs.rgb cor_dwi_ODFs.png</span><br>
<br>
<code><span style="font-family:Tahoma">The procedure is the same for the sagittal view:</span><br>
<br style="color:rgb(0,128,0)">
</code><span style="color:rgb(0,128,0); font-family:Courier New"># sagittal image (slice 61) - read 61st element of each axial row of data</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">sliceOffset=60</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">shredder $((sliceOffset*4)) $((1*4)) $((111*4)) < fa.img > sag_fa.Bfloat</span><br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">shredder $((sliceOffset*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">)) $((1*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">))
$((111*</span><code style="color:rgb(128,128,128); font-family:Courier New">(246+2)*8</code><span style="color:rgb(128,128,128); font-family:Courier New">)) <
</span><code style="color:rgb(128,128,128); font-family:Courier New">dwi_ODFs.Bdouble</code><span style="color:rgb(128,128,128); font-family:Courier New"> > sag_</span><code style="color:rgb(128,128,128); font-family:Courier New">dwi_ODFs.Bdouble</code><br style="color:rgb(128,128,128); font-family:Courier New">
<br>
<span style="font-family:Tahoma">The shredder command for the sagittal view follows the same principle. First, you skip a given number of voxels in a row. You then read a single voxel and then skip another 111 voxels (in this example there are 112 voxels
in a row). As before, the command gives you the data for a single slice of the volume and the offset controls the slice.</span><br>
<br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New"><span style="color:rgb(0,128,0)"># again, remember to update -projection so that the ODFs are being viewed from the correct direction!</span></span><br style="color:rgb(128,128,128); font-family:Courier New">
<code style="color:rgb(128,128,128); font-family:Courier New">sfplot -inputmodel rbf -rbfpointset 246 -rbfsigma 0.2618 -xsize 50 -ysize 112 -minifigsize 30 30 -minifigseparation 2 2 -minmaxnorm -dircolcode -projection 3 -1 -backdrop
</code><span style="color:rgb(128,128,128); font-family:Courier New">sag_fa.Bfloat</span><code style="color:rgb(128,128,128); font-family:Courier New"> <
</code><span style="color:rgb(128,128,128); font-family:Courier New">sag_</span><code style="color:rgb(128,128,128); font-family:Courier New">dwi_ODFs.Bdouble</code><code style="color:rgb(128,128,128); font-family:Courier New"> > sag_dwi_ODFs.rgb</code><br style="color:rgb(128,128,128); font-family:Courier New">
<br style="color:rgb(128,128,128); font-family:Courier New">
<span style="color:rgb(128,128,128); font-family:Courier New">convert -depth 8 -size 3584x1600 sag_dwi_ODFs.rgb sag_dwi_ODFs.png</span><br>
<br>
Hope that helps.<span class="HOEnZb"><font color="#888888"><br>
<br>
Kiran<br>
</font></span></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>