-
Notifications
You must be signed in to change notification settings - Fork 4
/
makePointStatsRef.m
executable file
·38 lines (26 loc) · 1.1 KB
/
makePointStatsRef.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
function makePointStatsRef(dataFolder,nRef)
% create and save a pointStats mat file with only the volumes used as
% references. This saves the references used so that other volumes can
% match to the references consistently. This program can eventually be
% modified to select the references in a smarter way than just uniformly
% spaced.
% Inputs:
% filePath: the dataFolder containing the pointStats.mat file
% nRef: the number of reference volumes to use
%Output:
% a file pointStatsRef.mat is saved inside the dataFolder.
%% write time start stamp
Fid=fopen([dataFolder filesep 'status.txt'],'a');
status=[datestr(datetime('now')) ': Starting NERVE tracking \n'];
fprintf(Fid,status);
fclose(Fid);
PS_file=[dataFolder filesep 'PointsStats.mat'];
load(PS_file)
%list of stacks presents
volList=find(cellfun(@(x) ~isempty(x),{pointStats.stackIdx}));
nVol=length(volList);
%the list of references to use
refList=unique(round(1:nVol/nRef:nVol));
refList=volList(refList);
PS_ref=pointStats(refList);
save([dataFolder filesep 'pointStatsRef.mat'],'PS_ref')