Home > fmri > utils > parse_brodmann.m

parse_brodmann

PURPOSE ^

parse_brodmann.m

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 parse_brodmann.m

 Parses the Brodmann map that is distributed with MRICRO into masks for each
 region.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % parse_brodmann.m
0002 %
0003 % Parses the Brodmann map that is distributed with MRICRO into masks for each
0004 % region.
0005 
0006 % 10/01/07 Petr Janata
0007 
0008 srcpath = '/afs/cmb.ucdavis.edu/share/petrlab/mrimasks/';
0009 destpath = srcpath;
0010 srcimg_fname = fullfile(srcpath,'xbrodmann.img');
0011 
0012 % Load the image data
0013 V = spm_vol(srcimg_fname);
0014 Y = spm_read_vols(V);
0015 
0016 % Get the list of unique values greater than 1
0017 unique_vals = unique(Y(:));
0018 
0019 brodmann_areas = unique_vals(unique_vals > 0);
0020 
0021 num_areas = length(brodmann_areas);
0022 for iarea = 1:num_areas
0023   curr_ba = brodmann_areas(iarea);
0024   
0025   fprintf('Working on Brodmann Area %d\n', curr_ba);
0026   
0027   Yout = zeros(size(Y));
0028   
0029   Yout(Y==curr_ba) = 1;
0030   
0031   Vout = V;
0032   Vout.fname = fullfile(destpath,sprintf('BA%d_mask.img', curr_ba));
0033   Vout.descrip = sprintf('BA%d mask based on Mricro Brodmann map', curr_ba);
0034   
0035   fprintf('\tWriting file: %s\n', Vout.fname);
0036   Vout = spm_write_vol(Vout,Yout);
0037   
0038 end
0039

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003