% determine the change in width of lines during shrinking process %% clear all; % load images x = imread('fig7_5.png'); ** THIS LINE MIGHT BE WRONG FILE x = sum(x,3); %% split the images im1 = x(1:3000,1:2300); im2 = x(1:3000,2400:4686); % plot in 2D before processing figure(1) subplot(1,2,1); imagesc(im1); colorbar; axis image; subplot(1,2,2); imagesc(im2); colorbar; axis image; %% SIZE OF LEFT-HS LINE im3 = x(1851:2500,1721:2215); scale = 0.656; period = 16; thr = 0.5; % USE FOR LEFT HAND SIDE LINE % im3 = x(1601:2500,3471:4140); scale = 1.33; period = 24; thr = 0.5; % USE FOR RIGHT HAND SIDE LINE im3 = max(im3(:))-im3; bg1 = im3(1:100,:); bg2 = im3(end-100:end,:); bg = mean([bg1(:); bg2(:)]); im3 = im3-bg; figure(1) subplot(1,2,1); imagesc(im3); subplot(1,2,2); imagesc(im3); axis image % figure(2) width_i = []; for line_i = 1:length(im3) a = im3(line_i,:); a = a./max(a(:)); b = []; % turn into single data points for i=1:period:length(a) b(end+1) = a(i); %#ok end % find thresholds, via linear interpolation % thr = 0.5; thr1 = 0; thr2 = 0; for i=1:length(b)-1; % left threshold cross if (b(i)thr && thr1==0) % only record first 'left' threshold thr1 = i + (0.5-b(i))/(b(i+1)-b(i)); end % right threshold cross if (b(i)>thr && b(i+1) end microns = width_i./scale; mean(microns) std(microns) %% figure(3) % g = g+0.0; g = g./max(g(:)); subplot(1,2,1); plot(f); subplot(1,2,2); plot(g);