function I = stretch(I)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% stretch.m
%
% test code for improving image stretch
% of images where amygdales are very
% FAINT!!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%find pixels that don't belong to core
ext=find(I<20);
I(ext)=1;
%crop
[I2]=imcrop(I,[223 264 423 520]);
mea=mean(mean(I2)); %two means needed as 1 mean averages each column only
%apply this value to boundary)
I(ext)=mea;
%stretch
I=imadjust(I);
I(ext)=1;
