Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
ljsctc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raymond Yung
ljsctc
Commits
2046b1f8
Commit
2046b1f8
authored
Feb 7, 2020
by
ac32
Browse files
Options
Downloads
Patches
Plain Diff
changed importExport to use ljsFetch (2019b), added eval1
parent
21b4452c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ctc/importExport/importExport.m
+11
-11
11 additions, 11 deletions
ctc/importExport/importExport.m
ctcOptimize/ctcEval1.m
+82
-0
82 additions, 0 deletions
ctcOptimize/ctcEval1.m
with
93 additions
and
11 deletions
ctc/importExport/importExport.m
+
11
−
11
View file @
2046b1f8
...
...
@@ -113,14 +113,14 @@ lbep=[];
for
i
=
1
:
length
(
tids
)
label
=
tids
(
i
);
cmd
=
[
'select min(time),max(time) from tblCells where trackID='
num2str
(
tids
(
i
))];
q
=
f
etch
(
conn
,
cmd
);
if
isempty
(
q
)
q
=
ljsF
etch
(
conn
,
cmd
);
if
isempty
(
q
)
||
0
==
size
(
q
,
1
)
continue
end
tBegin
=
q
{
1
};
tEnd
=
q
{
2
};
if
strcmp
(
tBegin
,
'null'
)
||
strcmp
(
tEnd
,
'null'
)
if
isempty
(
tBegin
)
||
isempty
(
tEnd
)
||
strcmp
(
tBegin
,
'null'
)
||
strcmp
(
tEnd
,
'null'
)
continue
end
% find our parent
...
...
@@ -128,14 +128,14 @@ for i=1:length(tids)
cmd
=
[
'select cellID,trackID,time from tblCells inner join tblFamilies on '
...
' cellID=cellID_parent where (cellID_child1='
num2str
(
tids
(
i
))
...
' or cellID_child2='
num2str
(
tids
(
i
))
') and cellID_child2 is not null'
];
q
=
f
etch
(
conn
,
cmd
);
if
isempty
(
q
)
q
=
ljsF
etch
(
conn
,
cmd
);
if
isempty
(
q
)
||
size
(
q
,
1
)
==
0
parent
=
0
;
else
parent
=
q
{
2
};
cmd
=
[
'select max(time) from tblCells where trackID='
num2str
(
parent
)];
q
=
f
etch
(
conn
,
cmd
);
if
~
isempty
(
q
)
q
=
ljsF
etch
(
conn
,
cmd
);
if
~
isempty
(
q
)
||
0
==
size
(
q
,
1
)
if
q
{
1
}
>
tBegin
fprintf
(
2
,
'found bad mitosis -- skipping\n'
);
parent
=
0
;
...
...
@@ -147,8 +147,8 @@ for i=1:length(tids)
cmd
=
[
'select cellID,trackID,time from tblCells inner join tblFamilies on '
...
' (cellID=cellID_child2 or cellID=cellID_child1) AND cellID_child2 is not null where cellID_parent IN '
...
' (select cellID from tblCells where trackID='
num2str
(
tids
(
i
))
')'
];
q
=
f
etch
(
conn
,
cmd
);
if
isempty
(
q
)
q
=
ljsF
etch
(
conn
,
cmd
);
if
isempty
(
q
)
||
0
==
size
(
q
,
1
)
childIDs
=
[
0
,
0
];
elseif
2
==
size
(
q
,
1
)
childIDs
=
[
q
{
1
,
1
},
q
{
2
,
1
}];
...
...
@@ -195,7 +195,7 @@ for t=1:CONSTANTS.imageData.NumberOfFrames
% splits via the tblEnsemble) covering up other segmentations
cmd
=
[
'select cellID,trackID from tblCells where time='
num2str
(
t
)
...
' and trackID IN '
tidString
'order by segCC asc'
];
Q
=
f
etch
(
conn
,
cmd
);
Q
=
ljsF
etch
(
conn
,
cmd
);
ctID
=
cell2mat
(
Q
);
im
=
zeros
(
szImage
);
...
...
@@ -240,7 +240,7 @@ end
for
i
=
1
:
length
(
idsMissing
)
% get the centroids
cmd
=
[
'select time,centroid from tblCells where trackID='
num2str
(
idsMissing
(
i
))];
q
=
f
etch
(
conn
,
cmd
);
q
=
ljsF
etch
(
conn
,
cmd
);
trackTime
=
cell2mat
(
q
(:,
1
));
cx
=
cellfun
(
@
jsondecode
,
q
(:,
2
),
'uniformoutput'
,
false
);
idx0
=
find
(
trackTime
==
t
-
1
);
...
...
This diff is collapsed.
Click to expand it.
ctcOptimize/ctcEval1.m
0 → 100644
+
82
−
0
View file @
2046b1f8
function
res
=
ctcEval1
(
strDB
)
gtPath
=
'/g/gRaw/ctc2020/'
;
evalFolder
=
'/f/ctcEval'
;
[
~
,
targetName
,
~
]
=
fileparts
(
strDB
);
thisFile
=
mfilename
(
'fullpath'
);
[
thisFolder
,
~
,
~
]
=
fileparts
(
thisFile
);
path
(
path
,
fullfile
(
thisFolder
,
'..'
,
'ctc/importExport'
));
outfolder
=
fullfile
(
evalFolder
,
'eval'
);
% results file
strResults
=
fullfile
(
evalFolder
,[
targetName
'_res.txt'
]);
if
exist
(
strResults
,
'file'
)
res
=
readtable
(
strResults
,
'delimiter'
,
','
);
else
res
=
[];
end
fname
=
strDB
;
fname
=
strrep
(
fname
,
'_training'
,
''
);
tokens
=
regexp
(
targetName
,
'(.*)_training_(\d\d)'
,
'tokens'
);
dsName
=
tokens
{
1
}{
1
};
dsID
=
tokens
{
1
}{
2
};
importExport
(
strDB
,
outfolder
,
[])
% copy over the ground truth
gtSource
=
fullfile
(
gtPath
,[
'2d_'
dsName
'_training'
],
dsName
,[
dsID
'_GT'
]);
if
~
exist
(
gtSource
,
'dir'
)
gtSource
=
fullfile
(
gtPath
,[
'3d_'
dsName
'_training'
],
dsName
,[
dsID
'_GT'
]);
end
if
~
exist
(
gtSource
,
'dir'
)
fprintf
(
2
,
'ground truth not found, skipping : %s\n'
,
gtSource
);
end
copyfile
(
gtSource
,
fullfile
(
outfolder
,
targetName
,[
dsID
'_GT'
]),
'f'
);
if
ispc
TRA
=
'TRAMeaseure.exe'
;
SEG
=
'SEGMeasure.exe'
;
DET
=
'DETMeasure.exe'
;
exePath
=
fullfile
(
'./'
,
'EvaluationSoftware/Win'
);
else
TRA
=
'TRAMeasure'
;
SEG
=
'SEGMeasure'
;
DET
=
'DETMeasure'
;
exePath
=
fullfile
(
'./'
,
'EvaluationSoftware/Linux'
);
end
system
([
fullfile
(
exePath
,
TRA
)
' '
...
fullfile
(
outfolder
,
targetName
)
' '
dsID
' > score.txt'
]);
system
([
fullfile
(
exePath
,
SEG
)
' '
...
fullfile
(
outfolder
,
targetName
)
' '
dsID
' >> score.txt'
]);
system
([
fullfile
(
exePath
,
DET
)
' '
...
fullfile
(
outfolder
,
targetName
)
' '
dsID
' >> score.txt'
]);
fid
=
fopen
(
'score.txt'
);
scoreTxt
=
fscanf
(
fid
,
'%s'
);
fclose
(
fid
);
sx
=
regexp
(
scoreTxt
,
'...measure:(\d\.\d+)'
,
'tokens'
);
sx
=
cellfun
(
@
str2double
,
sx
);
if
length
(
sx
)
<
3
,
sx
(
3
)
=
0
;
end
fprintf
(
1
,
'TRAmeasure:%f, SEGmeasure:%f, DETmeasure:%f\n'
,
sx
(
1
),
sx
(
2
),
sx
(
3
));
% get the algorithm settings
[
conn
,
CONSTANTS
]
=
openDB
(
strDB
);
segParams
=
Read
.
getSegmentationParams
(
conn
);
if
isempty
(
res
)
res
=
table
(
sx
,{
jsonencode
(
segParams
)},
'VariableNames'
,{
'TRA_SEG_DET'
,
'segParams'
});
else
res
=
[
res
;
sx
,{
jsonencode
(
segParams
)}];
end
close
(
conn
);
writetable
(
res
,
strResults
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment