[Camino-users] Bfloat to Matlab
Cook, Philip
cookpa at pennmedicine.upenn.edu
Mon Nov 13 08:24:28 PST 2017
Thanks Rodrigo.
I don't know much about TrackVis but the Camino streamline format is documented here:
http://camino.cs.ucl.ac.uk/index.php?n=Main.Fileformats#toc11
It's big-endian, 32-bit floats, which should be readable directly into Matlab if needed. You need to read them iteratively. The first value tells you how many points follow. The next is an integer index (but still stored as float) indicating which point is the seed point. Then the points themselves follow. Repeat until EOF.
On Nov 13, 2017, at 11:14 AM, Perea Camargo, Rodrigo Dennis <RPEREACAMARGO at mgh.harvard.edu<mailto:RPEREACAMARGO at mgh.harvard.edu>> wrote:
Hi Mahmoud,
In case this helps, I am currently working on some of these tools to read *.trk and *.trk.gz files in matlab (coming from trackvis/dsi_studio, it will be interesting to see if they also work with camino output).
The function to read these tracts is here: https://github.com/Drigomaniac/rotrk_landmarks/blob/master/rotrk_read.m
The Information was extracted from: http://www.trackvis.org/docs/?subsect=fileformat
Hope this helps,
Rodrigo
From: <camino-users-bounces at www.nitrc.org<mailto:camino-users-bounces at www.nitrc.org>> on behalf of Mahmoud <zeydabadi at gmail.com<mailto:zeydabadi at gmail.com>>
Date: Monday, November 13, 2017 at 11:06 AM
To: "camino-users at www.nitrc.org<mailto:camino-users at www.nitrc.org>" <camino-users at www.nitrc.org<mailto:camino-users at www.nitrc.org>>
Subject: [Camino-users] Bfloat to Matlab
Hello all,
I used the following commands to do tractography with camino. Could someone please let me know whether I did it right and if it's correct how can I read that bfloat file in MATLAB? My goal is to have the coordinate of fiber tracts in MATLAB.
fslmaths $1/$sub/data/data_FA.nii.gz -thr 0.3 -bin $1/$sub/tract/data_FA_thr03.nii.gz
cp $1/$sub/data/nodif_brain_mask_trimmed.nii.gz $1/$sub/tract/nodif_brain_mask_trimmed.nii.gz
TVFromEigenSystem -basename $1/$sub/data/data -type FSL -out $1/$sub/tract/data_tensor.nii.gz
/camino/bin/nii2dt -inputfile $1/$sub/tract/data_tensor.nii.gz -bgmask $1/$sub/tract/nodif_brain_mask_trimmed.nii.gz -uppertriangular > $1/$sub/tract/tensor.Bdouble
cat $1/$sub/tract/tensor.Bdouble | track -inputmodel dt -seedfile $1/$sub/tract/data_FA_thr03.nii.gz -outputroot $1/$sub/tract/WB_one_tensor -curvethresh 80 -anisthresh 0.3
camino_to_trackvis -i $1/$sub/tract/WB_one_tensor1.Bfloat -o $1/$sub/tract/WB_one_tensor.trk --nifti $1/$sub/tract/nodif_brain_mask_trimmed.nii.gz --phys-coords
Thank you!
Mahmoud
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
_______________________________________________
Camino-users mailing list
Camino-users at www.nitrc.org<mailto:Camino-users at www.nitrc.org>
https://www.nitrc.org/mailman/listinfo/camino-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.nitrc.org/pipermail/camino-users/attachments/20171113/bea43fda/attachment-0001.html>
More information about the Camino-users
mailing list