-
Notifications
You must be signed in to change notification settings - Fork 0
/
Load_CCR.m
46 lines (29 loc) · 813 Bytes
/
Load_CCR.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
function CCR = Load_CCR(CCRroot)
ROIavg = [ CCRroot '_ROIavg.dat'];
if ~exist(ROIavg, 'file')
error('ROIavg file does not exist');
end
fid = fopen(ROIavg,'r');
l = fgetl(fid);
InputImageFilename = l(2:end);
l = fgetl(fid);
FHCR = l(2:end);
l = fgetl(fid);
ROIFilename = l(2:end);
l = fgetl(fid);
ROIID = str2num(l);
l = fgetl(fid);
ROISize = str2num(l);
fclose(fid);
nROI = numel(ROIID);
if exist([CCRroot '_CCR.dat'],'file')
ccr= dlmread([CCRroot '_CCR.dat']);
elseif exist([CCRroot '_CCR.bin'],'file')
fid = fopen([CCRroot '_CCR.bin'],'r');
ccr = fread(fid,[nROI nROI],'single');
fclose(fid);
else
ccr = NaN;
end
CCR = struct('ImageFilename',InputImageFilename,'Format',FHCR,'ROIFilename',ROIFilename,'ROISize',ROISize,'ROIid',ROIID,'CCR',ccr);
end