Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/isetbio/isetbio
Browse files Browse the repository at this point in the history
  • Loading branch information
tlian7 committed Sep 7, 2018
2 parents 782173c + cd25188 commit 32eb337
Show file tree
Hide file tree
Showing 7 changed files with 399 additions and 176 deletions.
Binary file added data/datafiles/human/wvf/zCoefsPolans2015.mat
Binary file not shown.
505 changes: 357 additions & 148 deletions data/dataroutines/wvf/wvfLoadWavefrontOpticsData.m

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions external/psychtoolbox/+ptb/oiSetPtbOptics.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@
%% Get PTB optics as PSF
switch (p.Results.opticsModel)
case 'DeltaFunction'
theLsf = position1DMinutes*0;
centerPosition = round((numel(position1DMinutes)-1)/2);
theLsf(centerPosition+1) = 1;
thePsf = LsfToPsf(theLsf);
thePsf = zeros(size(xGridMinutes));
thePsf(centerPosition,centerPosition) = 1;
case 'Geisler'
theLsf = GeislerLSFMinutes(position1DMinutes);
thePsf = LsfToPsf(theLsf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function generateEMandMosaicComboVideo(fixEMobj, coneMosaic, varargin)
for iTrial = 1:nTrials
% Make figure
hFig = figure();
clf

set(hFig, 'Position', [10 10 figSize(1) figSize(2)], 'Color', [1 1 1]);
% Make subplots axes
if (showMovingMosaicOnSeparateSubFig)
Expand All @@ -113,11 +113,13 @@ function generateEMandMosaicComboVideo(fixEMobj, coneMosaic, varargin)
plot(axMosaic, crossLengthMeters * [-1 1], [0 0], 'k-', ...
'LineWidth', 2.0);
end

set(axMosaic, 'LineWidth', 1.0, 'FontSize', 20);
hold(axMosaic, 'off');
box(axMosaic, 'on');
end



% emPath for this trial
theEMpathMeters = squeeze(fixEMobj.emPosMicrons(iTrial, :, :)) * 1e-6;

Expand All @@ -130,11 +132,25 @@ function generateEMandMosaicComboVideo(fixEMobj, coneMosaic, varargin)
set(axMosaic, 'XLim', xo + visualizedSpaceMeters * ...
[-0.5 0.5] * 1.05, 'YLim', yo + visualizedSpaceMeters * ...
[-0.5 0.5] * 1.05, 'XTickLabel', {}, 'YTickLabel', {});
set(axMosaic, 'FontSize', 16, 'LineWidth', 1.0);
set(axMosaic, 'FontSize', 20, 'LineWidth', 1.0);
title(axMosaic, ...
sprintf('%2.1f msec', 1000 * fixEMobj.timeAxis(timeBin)));
end


% plot emPaths for previous trials
for k = 1: iTrial-1
theEMpathMetersOld = squeeze(fixEMobj.emPosMicrons(k, :, :)) * 1e-6;
plot(axEMpath, theEMpathMetersOld(:, 1), ...
theEMpathMetersOld(:, 2), 'k-', ...
'LineWidth', 2.0);
if (k == 1)
hold(axEMpath, 'on');
end
end



% Update the emPath
plot(axEMpath, theEMpathMeters(1:timeBin, 1), ...
theEMpathMeters(1:timeBin, 2), 'r-', 'Color', [1 0.5 0.5], ...
Expand Down Expand Up @@ -168,11 +184,15 @@ function generateEMandMosaicComboVideo(fixEMobj, coneMosaic, varargin)
xlabel(axEMpath, 'space (degs)');
grid(axEMpath, 'on');
box(axEMpath, 'on');
set(axEMpath, 'LineWidth', 1.0);
set(axEMpath, 'LineWidth', 1.0, 'FontSize', 20);

if (nTrials > 1)
title(axEMpath, sprintf('%2.1f msec (trial #%d)', ...
1000 * fixEMobj.timeAxis(timeBin), iTrial));
if (~showMovingMosaicOnSeparateSubFig)
title(axEMpath, sprintf('%2.1f msec (trial #%d)', ...
1000 * fixEMobj.timeAxis(timeBin), iTrial));
else
title(axEMpath, sprintf('trial #%d', iTrial));
end
else
title(axEMpath, sprintf('%2.1f msec', ...
1000 * fixEMobj.timeAxis(timeBin)));
Expand Down
9 changes: 6 additions & 3 deletions isettools/human/humanOTF.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [OTF2D, fSupport, wave] = humanOTF(pRadius, D0, fSupport, wave)
% Calculate the human OTF, including chromatic aberration
% Calculate the Marimont-Wandell human OTF, including chromatic aberration
%
% Syntax:
% [OTF2D, fSupport, wave] = ...
Expand Down Expand Up @@ -44,6 +44,8 @@
% History:
% xx/xx/03 Copyright ImagEval Consultants, LLC, 2003.
% 06/25/18 jnm Formatting, fix example to display both subplots
% 08/20/18 dhb Change fftshift -> ifftshift for storage of OTF.
% See isetbio issue #373 on github.

% Examples:
%{
Expand Down Expand Up @@ -148,8 +150,9 @@
% zero them out.
tmp(l) = 0;

% This is the proper storage format for the OI-ShiftInvariant case.
OTF2D(:, :, ii) = fftshift(tmp);
% This is the proper storage format for the OI-ShiftInvariant case,
% where the DC component goes to the upper left corner.
OTF2D(:, :, ii) = ifftshift(tmp);
end

end
23 changes: 8 additions & 15 deletions isettools/opticalimage/optics/opticsGet.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@
% worth it.]
% * [Note - DHB: Not all options appear to be documented in the above
% header comments.]
% * [Note: JNM - Fixed issue with variable naming in diffraction limited
% psf data]
% * TODO: When 2015B phased out, replace strfind() with contains()
%
Expand All @@ -198,6 +196,11 @@
% 12/21/17 dhb Use OtfToPsf to do the conversion, but with backwards
% compatible control.
% 03/14/18 jnm Formatting
% 08/30/18 dhb Replace abs(fft2(OTF)) with OtfToPsf for M-W optics,
% which was special cased for backward compatibility.
% This is based on the view that what was being done was
% not correct, and that we should bite the bullet and
% change. See issue #373 on github.
% Examples:
%{
Expand Down Expand Up @@ -829,22 +832,12 @@
if nWave == 1
% Just do one specified wavelength
otf = opticsGet(optics,'otf data',thisWave);
if strcmp(optics.name,'human-MW')
val = fftshift(abs(fft2(otf)));
else
[~,~,val] = OtfToPsf([],[],fftshift(otf));
end
[~,~,val] = OtfToPsf([],[],fftshift(otf));
else
% Do all the wavelenghts
val = zeros(size(optics.OTF.OTF));
if strcmp(optics.name,'human-MW')
for ii=1:length(thisWave)
val(:,:,ii) = fftshift(abs(fft2(optics.OTF.OTF(:,:,ii))));
end
else
for ii=1:length(thisWave)
[~,~,val(:,:,ii)] = OtfToPsf([],[],fftshift(optics.OTF.OTF(:,:,ii)));
end
for ii=1:length(thisWave)
[~,~,val(:,:,ii)] = OtfToPsf([],[],fftshift(optics.OTF.OTF(:,:,ii)));
end
end
Expand Down
Binary file removed tutorials/t_cones/video.m4v
Binary file not shown.

0 comments on commit 32eb337

Please sign in to comment.