Dear Bruce,
can we read the parcellation annotation file into matlab?
Essentially, how can we obtain a list of all the vertex indices and their classification?
Best, Darren
Hi Darren,
try the matlab script I've attached. It worked at one point in time, and there's a possibility that it still does :).
Let me know if it doesn't and I'll email you the c code that does.
cheers, Bruce
On Fri, 2 Jul 2004, Darren Weber wrote:
Dear Bruce,
can we read the parcellation annotation file into matlab?
Essentially, how can we obtain a list of all the vertex indices and their classification?
Best, Darren
Hi Bruce,
it seems to work. What are the values in the vector returned?
Best, Darren
Bruce Fischl wrote:
Hi Darren,
try the matlab script I've attached. It worked at one point in time, and there's a possibility that it still does :).
Let me know if it doesn't and I'll email you the c code that does.
cheers, Bruce
On Fri, 2 Jul 2004, Darren Weber wrote:
Dear Bruce,
can we read the parcellation annotation file into matlab?
Essentially, how can we obtain a list of all the vertex indices and their classification?
Best, Darren
function [annots] = read_annotation(fname)
% % [annots] = read_annotation(fname) % reads a binary annotation file into a vector %
% open it as a big-endian file fid = fopen(fname, 'rb', 'b') ; if (fid < 0) str = sprintf('could not open annotation file %s.', fname) ; error(str) ; end vnum = fread(fid, 1, 'int32') ; tmp = fread(fid, vnum*2, 'int') ; annots = tmp(2:2:vnum*2) ; fclose(fid) ;
Hi Darren,
it is r,g,b stuffed into a 32 bit quantity:
annotation = r+(g << 8)+(b << 16)
cheers, Bruce
On Sat, 3 Jul 2004, Darren Weber wrote:
Hi Bruce,
it seems to work. What are the values in the vector returned?
Best, Darren
Bruce Fischl wrote:
Hi Darren,
try the matlab script I've attached. It worked at one point in time, and there's a possibility that it still does :).
Let me know if it doesn't and I'll email you the c code that does.
cheers, Bruce
On Fri, 2 Jul 2004, Darren Weber wrote:
Dear Bruce,
can we read the parcellation annotation file into matlab?
Essentially, how can we obtain a list of all the vertex indices and their classification?
Best, Darren
function [annots] = read_annotation(fname)
% % [annots] = read_annotation(fname) % reads a binary annotation file into a vector %
% open it as a big-endian file fid = fopen(fname, 'rb', 'b') ; if (fid < 0) str = sprintf('could not open annotation file %s.', fname) ; error(str) ; end vnum = fread(fid, 1, 'int32') ; tmp = fread(fid, vnum*2, 'int') ; annots = tmp(2:2:vnum*2) ; fclose(fid) ;
freesurfer@nmr.mgh.harvard.edu