[Camino-users] sfplot warning/error
Zhuang Song
zhuang.song at gmail.com
Wed Aug 15 13:53:05 PDT 2012
Hi Kiran,
It works perfectly now. Thank you for the great help. I will let you know
the results of the coronal/sagittal views later.
Zhuang
On Wed, Aug 15, 2012 at 1:31 PM, Seunarine, Kiran <k.seunarine at ucl.ac.uk>wrote:
> Hi Zhuang,
>
> Sorry, this is my bad - I used the wrong input in the fa command! If
> you use:
>
> fa < dt.Bdouble > fa.img
>
> 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
>
> shredder $((sliceOffset*112*8)) $((1*112*8)) $((111*112*8)) < fa.img >
> cor_fa.Bfloat
>
> shredder $((sliceOffset*8)) $((1*8)) $((111*8)) < fa.img > sag_fa.Bfloat
>
> Hope that helps.
>
> Kiran
> ------------------------------
> *From:* Zhuang Song [zhuang.song at gmail.com]
> *Sent:* 15 August 2012 20:48
> *To:* Seunarine, Kiran
> *Cc:* camino-users at www.nitrc.org; Rowe, Matthew
> *Subject:* Re: [Camino-users] sfplot warning/error
>
> Hi Kiran and Matt,
>
> Thank you both for the thoughts and suggestions. To create the FA map, I
> used the scripts in the online Tutorial for DTI (
> http://cmic.cs.ucl.ac.uk/camino//index.php?n=Tutorials.DTI):
>
> for PROG in fa md; do
> cat dt.Bdouble | ${PROG} | voxel2image -outputroot ${PROG} -header 4Ddwi_b1000.nii.gz
>
> done
>
> 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: fa < dwi.Bfloat > fa.img, because there was no fa.hdr
> in the output as in the ANALYZE format.
>
> However there is still a problem with 'split' after using Kiran's script
> to generate fa.img. By running split -b $((112*112*8)) fa.img
> splitBrain/fa_slice (for the example human brain data in the tutorial), the
> total slice number of the FA map become 104, which is supposed to be 50.
> What would be the problem now?
>
> 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.
>
> Many thanks,
> Zhuang
>
>
> On Tue, Aug 14, 2012 at 8:37 AM, Seunarine, Kiran <k.seunarine at ucl.ac.uk>wrote:
>
>> Hi Zhuang,
>>
>> 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.
>>
>> fa < dwi.Bfloat > fa.img
>>
>> 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.
>>
>> 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
>>
>> # coronal image (slice 61) - read 11th row of each axial slice
>> sliceOffset=60
>> shredder $((sliceOffset*112*4)) $((1*112*4)) $((111*112*4)) < fa.img >
>> cor_fa.Bfloat
>> shredder $((sliceOffset*112*(246+2)*8)) $((1*112*(246+2)*8)) $((111*112*
>> (246+2)*8)) < dwi_ODFs.Bdouble > cor_dwi_ODFs.Bdouble
>>
>> 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.
>>
>> # plot as usual, but remember to update -projection so that the ODFs are
>> being viewed from the correct direction!
>> 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
>>
>> convert -depth 8 -size 3584x1600 cor_dwi_ODFs.rgb cor_dwi_ODFs.png
>>
>> The procedure is the same for the sagittal view:
>>
>> # sagittal image (slice 61) - read 61st element of each axial row of data
>> sliceOffset=60
>> shredder $((sliceOffset*4)) $((1*4)) $((111*4)) < fa.img > sag_fa.Bfloat
>> shredder $((sliceOffset*(246+2)*8)) $((1*(246+2)*8)) $((111*(246+2)*8))
>> < dwi_ODFs.Bdouble > sag_dwi_ODFs.Bdouble
>>
>> 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.
>>
>> # again, remember to update -projection so that the ODFs are being viewed
>> from the correct direction!
>> sfplot -inputmodel rbf -rbfpointset 246 -rbfsigma 0.2618 -xsize 50 -ysize
>> 112 -minifigsize 30 30 -minifigseparation 2 2 -minmaxnorm -dircolcode
>> -projection 3 -1 -backdrop sag_fa.Bfloat < sag_dwi_ODFs.Bdouble >
>> sag_dwi_ODFs.rgb
>>
>> convert -depth 8 -size 3584x1600 sag_dwi_ODFs.rgb sag_dwi_ODFs.png
>>
>> Hope that helps.
>>
>> Kiran
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/camino-users/attachments/20120815/95bbf713/attachment-0001.html
More information about the Camino-users
mailing list