% stage = 'S3';
% imagedir = 'A3';
% gridname = 'grid_data_5_by_5.mat';
% region_number = 1;
% l = load(['Staged', filesep, stage, filesep, imagedir, filesep, 'RegionData\region_info_', gridname]);

[filename, pathname] = uigetfile('*.mat', 'Pick an M-file');
if isequal(filename,0) | isequal(pathname,0)
    disp('User pressed cancel')
else
    disp(['User selected ', fullfile(pathname, filename)])
    l = load([pathname, filesep, filename]);
end
l = l.RegionInfo;
l = l{region_number};
figure(1); clf;
hold on;
for i=1:size(l,1)
   c.Centroid(1) = l(i,1);
   c.Centroid(2) = l(i,2);
   c.Area = l(i,3);
   c.MajorAxisLength = l(i,4);
   c.MinorAxisLength = l(i,5);
   c.Orientation = l(i,6);
   plot_ellipse(gca, c);
end



