| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| function alpha_per_pix = dlg_calcvisangle(callingFcn) |
|
|
| geometry = {1 1 [3 1 1] 1 [3 1 1] 1 [3 1 1]}; |
|
|
| |
| uilist = {... |
| {'Style', 'text', 'string', 'Compute visual angle of one screen pixel:','fontweight', 'bold'},... |
| {},... |
| {'Style', 'text', 'string', 'Horizontal width of screen [in millimeters]'},... |
| {'Style', 'edit', 'string', '400','tag','xmm'},... |
| {'Style', 'text', 'string', 'mm'},... |
| {},... |
| {'Style', 'text', 'string', 'Horizontal resolution of screen [in pixels]'},... |
| {'Style', 'edit', 'string', '1024','tag','xres' },... |
| {'Style', 'text', 'string', 'pixel'},... |
| {},... |
| {'Style', 'text', 'string', 'Viewing distance [in millimeters]'},... |
| {'Style', 'edit', 'string', '700','tag','distmm'},... |
| {'Style', 'text', 'string', 'mm'},... |
| }; |
|
|
| [results tmp tmp outstruct] = inputgui( 'geometry',geometry, ... |
| 'uilist',uilist,'helpcom', ['pophelp(''' callingFcn ''');'],... |
| 'title', ['Compute visual angle per pixel -- ', callingFcn] ); |
|
|
| |
| if ~isempty(results) |
| screenwidth = str2num(outstruct.xmm); |
| resolution = str2num(outstruct.xres); |
| viewingdist = str2num(outstruct.distmm); |
| |
| try |
| |
| mm_per_pix = screenwidth/resolution; |
| alpha_per_pix = 180/pi*(2*atan(mm_per_pix/viewingdist/2)); |
| |
| catch |
| alpha_per_pix = []; |
| end |
| else |
| alpha_per_pix = []; |
| return |
| end |
|
|
|
|
| end |