% Calibration Curve (calibrate k)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This program enables the user to input an ASCII file of calibrated images to calculate
% average phase from a predefined area. The values are then entered into an Excel table
% to plot the calibration curve
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp ('This first part is to choose the area of interest. Please enter the parameters');
% To get the area of interest
X1 = input ('Enter X starting pt>');
X2 = input ('Enter X ending pt>');
Y1 = input ('Enter Y starting pt>');
Y2 = input ('Enter Y ending pt>');
disp ('This next part is to get the output file name and input filename(s)');
cont = 'y';
i = 1;
Img_file = input ('ASCII output filename>','s');
while cont ~= 'n'
Img_file1 = input ('ASCII filename of unwrapped image>','s');
I = load (Img_file1 );
I1 = double (I);
I2 = I1(X1:X2,Y1:Y2);
Mean = mean(I2); %then average the area
MeanMean = mean(Mean)
Array(i,1) = MeanMean;
clear I I1 I2 map Mean MeanMean
i=i+1;
cont = input ('Continue y/n? >','s');
end,
dlmwrite(Img_file,Array,' ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This program enables the user to input an ASCII file of calibrated images to calculate
% average phase from a predefined area. The values are then entered into an Excel table
% to plot the calibration curve
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp ('This first part is to choose the area of interest. Please enter the parameters');
% To get the area of interest
X1 = input ('Enter X starting pt>');
X2 = input ('Enter X ending pt>');
Y1 = input ('Enter Y starting pt>');
Y2 = input ('Enter Y ending pt>');
disp ('This next part is to get the output file name and input filename(s)');
cont = 'y';
i = 1;
Img_file = input ('ASCII output filename>','s');
while cont ~= 'n'
Img_file1 = input ('ASCII filename of unwrapped image>','s');
I = load (Img_file1 );
I1 = double (I);
I2 = I1(X1:X2,Y1:Y2);
Mean = mean(I2); %then average the area
MeanMean = mean(Mean)
Array(i,1) = MeanMean;
clear I I1 I2 map Mean MeanMean
i=i+1;
cont = input ('Continue y/n? >','s');
end,
dlmwrite(Img_file,Array,' ');

