data = double(nefRead('D70_res.NEF'));

%for simplicity, just use green channels
g1 = data(:,:,2);
g2 = data(:,:,4);
image = (g1+g2)/2;
%image = data(:,:,1);

MTF_d70 = zeros(13,1);
frequencies = [1 2 3 4 5 6 8 10 12 14 16 18 20];


%1 through 6
curr_region = image(390, 618:682);
MTF_d70(1) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(440, 632:667);
MTF_d70(2) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(492, 637:662);
MTF_d70(3) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(544, 641:658);
MTF_d70(4) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(595, 642:657);
MTF_d70(5) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(646, 644:656);
MTF_d70(6) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));

%8 through 20
curr_region = image(439, 860:876);
MTF_d70(7) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(474, 861:875);
MTF_d70(8) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(508, 881:897);
MTF_d70(9) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(542, 880:895);
MTF_d70(10) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(576, 880:895);
MTF_d70(11) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(611, 878:894);
MTF_d70(12) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));
curr_region = image(644, 864:872);
MTF_d70(13) = (max(curr_region)-min(curr_region))/(max(curr_region)+min(curr_region));