fise_humanLSF
Illustrate the human line spread function at different wavelengths. The purpose is to show the very large longitudinal chromatic aberration of the human eye, and to illustrate the linespread.
This script requires ISETBio on your path so that we can access the human Lens object.
We use the wavefront human optics model from Larry Thibos' average subject.
See also:
s_humanLSF, t_humanLineSpreadOI
Initialize ISETCam/ISETBio
names = {'EE','425 nm','525 nm','625 nm'};
Create a broadband line
scene{1} = sceneCreate('lineee',imSize); % Equal energy SPD for a thin line
scene{1} = sceneSet(scene{1},'fov',0.5); % Small field of view
Make scenes for several different wavelengths
scene{2} = sceneInterpolateW(scene{1},425);
scene{3} = sceneInterpolateW(scene{1},525);
scene{4} = sceneInterpolateW(scene{1},625);
Run the optical calculation for each of the lines
oi = oiCompute(oi,scene{ii});
oi = oiSet(oi,'name',names{ii});
rgb{ii} = oiGet(oi,'rgb'); % Store the image
support{ii} = oiGet(oi,'spatial support linear','um');
lPlot{ii} = oiPlot(oi,'illuminance hline',[1 320],'nofigure');
Show the linespreads in a single figure
figHandle = ieFigure; %#ok<NASGU>
imagesc(gca,support{ii}.x,support{ii}.y,rgb{ii});
set(gca,'GridColor',[1 1 1],'GridLineWidth',1.2);
set(gca,'xtick',xticks,'ytick',yticks);
xlabel('um'); ylabel('um'); hold on;
data = interp1(lPlot{ii}.pos,lPlot{ii}.data,support{ii}.x);
plot(gca,support{ii}.x,50*data/max(data(:)),'w--'); hold on;
% Export the figure to a PNG file
drawnow; % Ensure the figure is rendered before exporting
filename = fullfile(fiseRootPath,'chapters','images','optics','linespread.png');
exportgraphics(figHandle, filename, 'Resolution', 300);
scene{1} = sceneCreate('point array',imSize,256);
scene{1} = sceneSet(scene{1},'fov',0.5); % Small field of view
Make scenes for several different wavelengths
scene{2} = sceneInterpolateW(scene{1},425);
scene{3} = sceneInterpolateW(scene{1},525);
scene{4} = sceneInterpolateW(scene{1},625);
Run the optical calculation for each of the lines
names = {'EE','425','525','625'};
oi = oiCompute(oi,scene{ii});
oi = oiSet(oi,'name',names{ii});
rgb{ii} = oiGet(oi,'rgb'); % Store the image
support{ii} = oiGet(oi,'spatial support linear','um');
Show the point spreads in a single figure
imagesc(gca,support{ii}.x,support{ii}.y,rgb{ii});
set(gca,'GridColor',[1 1 1],'GridLineWidth',1.2);
set(gca,'xtick',xticks,'ytick',yticks);
xlabel('um'); ylabel('um'); hold on;
% Export the figure to a PNG file
drawnow; % Ensure the figure is rendered before exporting
filename = fullfile(fiseRootPath,'chapters','images','optics','pointspread.png');
exportgraphics(figHandle, filename, 'Resolution', 300);