-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReadinImageVirusesfunc.m
51 lines (42 loc) · 1.23 KB
/
ReadinImageVirusesfunc.m
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
41
42
43
44
45
46
47
48
49
50
51
function [tab, imvirus, fregions, imvirusname] = ReadinImageVirusesfunc
%Function that reads in image, determine shape and plot onto image
% Get the image; user selected
use_input_dialog = true;
if use_input_dialog == true
%% Input dialog
% input SIM data
[imvirusname,path] = uigetfile({'*.tif';'*.*'},'File Selector');
% exception handling
if imvirusname == 0
return
end
end
% Read the image
imvirus = imread(fullfile(path, imvirusname));
figure;
imagesc(imvirus);
colorbar
% button = questdlg('Gaussian Smoothing for STORM?','Smoothing?','Yes','No','No');
% switch button
% case 'Yes'
% imvirus = imgaussfilt(imvirus,2,'FilterDomain','spatial');
% figure
% imagesc(imvirus);
% case 'No'
%
% otherwise
% return
% end
% Creates a binary image
BW = blackwhitevirus(imvirus);
figure;
imagesc(BW);
colorbar;
%Regions are found within the virus image
[~,fregions] = regionsfindvirus(BW, imvirus,imvirusname); %, diameterofvirus, resolution, pixelsize
%saves the regions to a table
tab = regwritetotab(fregions);
imvirusname = imvirusname(1:4);
name = [imvirusname 'regions']; %save this table
xlswrite(name,tab);
end