Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GEPARD
GEPARD
Commits
fcca6561
Commit
fcca6561
authored
Jul 17, 2019
by
Josef Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in calculation of particle stats
parent
b421c24d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
analysis/particleeditor.py
analysis/particleeditor.py
+8
-4
No files found.
analysis/particleeditor.py
View file @
fcca6561
...
...
@@ -143,7 +143,8 @@ class ParticleEditor(QtCore.QObject):
print
(
f
'Combining particles
{
contourIndices
}
into
{
newAssignment
}
'
)
contours
=
self
.
particleContainer
.
getParticleContoursByIndex
(
contourIndices
)
newContour
=
self
.
mergeContours
(
contours
.
copy
())
stats
=
self
.
characterizeParticle
(
newContour
)
pixelscale
=
self
.
viewparent
.
dataset
.
getPixelScale
()
stats
=
self
.
characterizeParticle
(
newContour
,
pixelscale
)
self
.
particleContainer
.
mergeParticles
(
contourIndices
,
newContour
,
stats
,
newAssignment
=
newAssignment
)
for
ind
in
contourIndices
:
...
...
@@ -178,7 +179,8 @@ class ParticleEditor(QtCore.QObject):
def
acceptPaintedResult
(
self
):
newContour
=
self
.
mergeContours
(
self
.
particlePainter
.
contours
.
copy
())
stats
=
self
.
characterizeParticle
(
newContour
)
pixelscale
=
self
.
viewparent
.
dataset
.
getPixelScale
()
stats
=
self
.
characterizeParticle
(
newContour
,
pixelscale
)
self
.
particleContainer
.
mergeParticles
(
self
.
storedIndices
,
newContour
,
stats
,
newAssignment
=
self
.
storedAssignmend
)
for
ind
in
self
.
storedIndices
:
...
...
@@ -237,7 +239,7 @@ class ParticleEditor(QtCore.QObject):
return
newContour
def
characterizeParticle
(
self
,
contours
):
def
characterizeParticle
(
self
,
contours
,
pixelscale
):
##characterize particle
longellipse
,
shortellipse
=
np
.
nan
,
np
.
nan
...
...
@@ -251,8 +253,10 @@ class ParticleEditor(QtCore.QObject):
long
,
short
=
rect
[
1
]
if
short
>
long
:
long
,
short
=
short
,
long
area
=
cv2
.
contourArea
(
cnt
)
return
long
,
short
,
longellipse
,
shortellipse
,
cv2
.
contourArea
(
cnt
)
return
long
*
pixelscale
,
short
*
pixelscale
,
longellipse
*
pixelscale
,
shortellipse
*
pixelscale
,
area
*
pixelscale
**
2
@
QtCore
.
pyqtSlot
(
list
)
def
deleteParticles
(
self
,
contourIndices
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment