-
Notifications
You must be signed in to change notification settings - Fork 0
/
readSDT.m
54 lines (41 loc) · 1.14 KB
/
readSDT.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
52
53
54
% Reads SDT FLIM files with BIOformats
% Author: Md Abdul Kader Sagar([email protected])
% LOCI, UW Madison
%
% Will prompt the user to either generate new file or use old file(reading
% new file will automatically be saved in a .mat file). It is helpful when same data is run several times
% bioformat path should be added to MATLAB, direction available in BF
% website
close all
clear all
% bin=3;
noOfBin=256;%This is 256 most of the times for regular data
M=256;
N=256;
P=256;
A=zeros(M,N,P);
% noOfBin=256;
% 1, prompts the user for new data
% 0, run based on last data, this is faster
% Construct a questdlg with three options
choice = questdlg('Would you like to load new data?', ...
'choice','Yes, new data','use saved data','default');
% Handle response
switch choice
case 'Yes, new data'
generateData = 1;
case 'use saved data'
generateData = 0;
case 'default'
return;
end
if(generateData==1)
cellData=bfopen %Requires bioformat path to be added
data3D=cellData{1,1}(:,1);%taking the 3d array with decay
for k = 1:noOfBin
A(k,:,:) = data3D{k};
end
save A
else
load A
end