-
Notifications
You must be signed in to change notification settings - Fork 25
/
demo_postprocess.m
33 lines (26 loc) · 1.21 KB
/
demo_postprocess.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
%% Demo script that processes the neuron probability map inferred by STNeuroNet
addpath(genpath('Software'))
%% Set directories
name = '524691284';
DirProbMap = ['Results',filesep,'ABO',filesep,'Probability map',filesep];
DirData = ['Dataset',filesep,'ABO',filesep];
DirGTMasks = ['Markings',filesep,'ABO',filesep,'Layer275',filesep,'FinalGT',filesep];
DirThresh = ['Results',filesep,'ABO',filesep,'Thresholds',filesep];
%% Data order (DO NOT change)
id = [524691284, 531006860,502608215, 503109347,501484643, 501574836,...
501729039, 539670003,510214538, 527048992];
ind = find(id == str2num(name));
%% Set parameters
pixSize = 0.78; %um
meanR = 5.85; % neuron radius in um
AvgArea = round(pi*(meanR/pixSize)^2);
ThreshJ = 0.5;
load([DirThresh,'OptParam_Final_JaccardNew_LOO_whitened.mat']);
minArea = minArea(ind);
thresh = ProbThresh(ind);
%% run postprocessing and performance evaluation
[finalSegments,MCOM] = postProcess(DirProbMap,name,[487,487],...
AvgArea,minArea,thresh);
if ~isempty(DirGTMasks)
[Recall,Precision,F1] = GetPerformance_Jaccard(DirGTMasks,name,finalSegments,ThreshJ);
end