Hi Saeideh,
Which region? For cortical regions you may want to use an application
that constructs surface-based representations of the brain (e.g.
FreeSurfer, BrainVISA, Caret, etc).
For subcortical regions, if you used FSL/FIRST, you can use the attached
MATLAB function to calculate the area of each mesh for each subject,
which FSL saves in VTK format. Note that there are many types of VTK
files and the function will only work for polygonal data ("polydata"),
saved in ASCII format, exactly as saved by FSL.
Hope it helps!
All the best,
Anderson
On 04/21/2011 10:53 PM, Saeideh Bakhshi wrote:
> Hi
>
> I was wondering how I can find the surface area of a region in FSL. I
> know how to find the volume and center of gravity, but is there a way
> that we can also know the surface area?
>
> Thanks,
>
> Saeideh Bakhshi,
> PhD student at Networking and Telecommunications Group
> School of Computer Science, College of Computing , Georgia Institute
> of Technology
> Atlanta, Georgia, 30332-0280
> http://www.cc.gatech.edu/~sbakhshi/
>
>
function Atotal = vtkarea(filename)
% Compute the area of a subcortical region
% from a VTK file generated by FSL-FIRST.
%
% Usage:
% area = vtkarea(filename)
%
% _____________________________________
% Anderson M. Winkler
% Yale University / Institute of Living
% Nov/2009
[Vtx,Fac] = vtkread(filename);
A = zeros(size(Fac,1));
for f = 1:size(Fac,1),
M = zeros(3);
for v = 1:3,
M(:,v) = Vtx(Fac(f,v),:)';
end
A(f) = calc_tri(M);
end
Atotal = sum(A(:));
function Area = calc_tri(M)
Mxy = M; Mxy(3,:) = [1 1 1];
Myz = M; Myz(1,:) = [1 1 1];
Mxz = M; Mxz(2,:) = [1 1 1];
Area = .5 * sqrt(det(Mxy)^2 + det(Myz)^2 + det(Mxz)^2);
function [Vtx,Fac] = vtkread(filename)
% This is not supposed to read any other VTK file, but only
% those such as created by FSL-FIRST (i.e. POLIDATA).
%
% Usage:
% [vtx,fac] = vtkread(filename)
%
% _____________________________________
% Anderson M. Winkler
% Yale University / Institute of Living
% Nov/2009
fid = fopen(filename);
T = textscan(fid,'%s','CommentStyle','#','Delimiter','*'); % fake delimiter
fclose(fid);
for t = 1:10,
if strcmp(T{1,1}{t,1}(1:5),'POINT'),
nVtx = textscan(T{1,1}{t,1},'%s');
nVtx = str2num(nVtx{1,1}{2,1});
Vtx = zeros(nVtx,3);
for v = 1:nVtx,
tmpvar = textscan(T{1,1}{v+t,1},'%n');
Vtx(v,:) = tmpvar{1}';
end
blah = t+nVtx+1;
nFac = numel(T{1,1})-blah;
Fac = zeros(nFac,3);
for f = 1:nFac,
tmpvar = textscan(T{1,1}{f+blah,1},'%n');
Fac(f,:) = tmpvar{1}(2:4)';
end
end
end
Fac = Fac+1;
|