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
fb6d807f
Commit
fb6d807f
authored
May 13, 2020
by
ac 20
Browse files
Options
Downloads
Patches
Plain Diff
clipTracks based on surface/vertex instead of centroid
parent
9e9f93f2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/clipTracks.m
+25
-7
25 additions, 7 deletions
src/clipTracks.m
with
25 additions
and
7 deletions
src/clipTracks.m
+
25
−
7
View file @
fb6d807f
...
...
@@ -8,26 +8,44 @@ tids=exportGetExtFamilies(conn,CONSTANTS,gtFile);
if
isempty
(
tids
)
return
;
end
xyClip
=
FOI
(
CONSTANTS
.
imageData
.
DatasetName
)
/
2
;
xyClip
=
FOI
(
CONSTANTS
.
imageData
.
DatasetName
);
xySize
=
CONSTANTS
.
imageData
.
Dimensions
;
if
xyClip
>
0
qFamilies
=
fetch
(
conn
,
'select * from tblFamilies where cellID_child2 is not null'
);
cidFamilies
=
table2cell
(
qFamilies
);
cidFamilies
=
[
cidFamilies
{:}];
for
i
=
1
:
length
(
tids
)
q
=
fetch
(
conn
,[
'select cellID,trackID,time,centroid from tblCells where trackID='
...
if
is3D
(
CONSTANTS
)
q
=
fetch
(
conn
,[
'select cellID,trackID,time,verts from tblCells where trackID='
...
num2str
(
tids
(
i
))
' and channel=1'
]);
if
~
isempty
(
q
)
surf
=
cellfun
(
@
(
x
)
typecast
(
x
,
'single'
),
q
.
verts
,
'UniformOutput'
,
false
);
surf
=
cellfun
(
@
(
x
)
reshape
(
x
,
3
,[])
',surf,'
UniformOutput
'
,
false
);
end
else
q
=
fetch
(
conn
,[
'select cellID,trackID,time,surface from tblCells where trackID='
...
num2str
(
tids
(
i
))
' and channel=1'
]);
if
~
isempty
(
q
)
surf
=
cellfun
(
@
(
x
)
jsondecode
(
x
),
q
.
surface
,
'UniformOutput'
,
false
);
end
end
if
isempty
(
q
)
cmd
=
[
'delete from uiExtFamily where trackID='
num2str
(
tids
(
i
))];
exec
(
conn
,
cmd
);
continue
;
end
centroids
=
cell2mat
(
cellfun
(
@
jsondecode
,
q
.
centroid
,
'UniformOutput'
,
false
));
centroids
=
reshape
(
centroids
,
3
,[])
'
;
surfMin
=
cellfun
(
@
(
x
)
[
min
(
x
(:,
1
:
2
))],
surf
,
'UniformOutput'
,
false
);
surfMin
=
cell2mat
(
surfMin
);
surfMax
=
cellfun
(
@
(
x
)
[
max
(
x
(:,
1
:
2
))],
surf
,
'UniformOutput'
,
false
);
surfMax
=
cell2mat
(
surfMax
);
idxClip
=
find
(
centroids
(:,
1
)
<
xyClip
|
centroids
(:,
2
)
<
xyClip
|
...
xySize
(
1
)
-
centroids
(:,
1
)
<
xyClip
|
xySize
(
2
)
-
centroids
(:,
2
)
<
xyClip
);
idxClip
=
find
(
surfMax
(:,
1
)
<
xyClip
|
surfMax
(:,
2
)
<
xyClip
|
...
xySize
(
1
)
-
surfMin
(:,
1
)
<
xyClip
|
xySize
(
2
)
-
surfMin
(:,
2
)
<
xyClip
);
if
isempty
(
idxClip
)
continue
end
cidClip
=
q
.
cellID
(
idxClip
);
strClip
=
jsonencode
(
cidClip
);
if
length
(
idxClip
)
>
1
...
...
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