function ConvertFSaverageAnnotationToLabels(hemi)

avg_mesh = ReadNCAvgMesh(hemi, 'fsaverage', 'inflated', 'aparc.annot');
index = unique(avg_mesh.MARS_label);

for i = 1:length(index)

lindex = transpose(find(avg_mesh.MARS_label == i));
lxyz = avg_mesh.vertices(:, lindex)';
lvals = zeros(size(lindex));

label_file = fullfile([hemi 'labels'], [hemi '.' num2str(i)]);
write_label(lindex-1, lxyz, lvals, label_file);
end