-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathoptimPSFZernike_unitTest.m
More file actions
40 lines (34 loc) · 1.01 KB
/
Copy pathoptimPSFZernike_unitTest.m
File metadata and controls
40 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [Report]=optimPSFZernike_unitTest()
%optimPSFZernike_unitTest Tests optimPSFZernike functionality.
%
% OUTPUTS:
% Report
%
% REQUIRES:
% Parallel Procesing Toolbox
% NVidia GPU
%
Report = 0;
SaveDir = smi_helpers.mkSMITETmpDir('unitTest', 'optimPSFZernike');
%% Blind start. Search for Astigmatism
P=smi_psf.PointSpreadFunction.createPSFStruct();
PhaseMask=0;
PhaseMask(6)=1; %Vertical Astigmatism
%clc;
[PFound,PSF,CRLB_Astig]=smi_psf.PointSpreadFunction.optimPSFZernike(P,PhaseMask);
saveas(gcf, fullfile(SaveDir, 'oPZ1.png'));
%% Directed Start. Search for Tetrapod
P=smi_psf.PointSpreadFunction.createPSFStruct();
PhaseMask=0;
PhaseMask(6)=1; %Vertical Astigmatism
PhaseMask(12)=1; %Vertical Second Order Astigmatism
PhaseMask(24)=0; %Vertical Second Order Astigmatism
P.ZC_Phase(6)=1;
P.ZC_Phase(12)=-2;
P.ZC_Phase(24)=2;
%clc;
[PFound_Tet,PSF3,CRLB_Tetra]=smi_psf.PointSpreadFunction.optimPSFZernike(P,PhaseMask,P.ZC_Phase);
PFound_Tet.ZC_Phase
saveas(gcf, fullfile(SaveDir, 'oPZ2.png'));
Report = 1;
end