Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ttk
spam
Commits
d247837c
Commit
d247837c
authored
Mar 12, 2021
by
Edward Andò
Browse files
numpy indexing with tuples with contacts
parent
e3db4f22
Pipeline
#62738
passed with stages
in 25 minutes and 37 seconds
Changes
1
Pipelines
8
Hide whitespace changes
Inline
Side-by-side
tools/label/contacts.py
View file @
d247837c
...
...
@@ -284,16 +284,16 @@ def contactPoints(lab, contactPairs, returnContactZones=False, boundingBoxes=Non
dilOnly
=
numpy
.
logical_xor
(
p2
[
'subvol'
],
p1
[
'subvol'
])
labSlice
=
[
slice
(
p1
[
'slice'
][
0
].
start
,
p1
[
'slice'
][
0
].
stop
),
labSlice
=
(
slice
(
p1
[
'slice'
][
0
].
start
,
p1
[
'slice'
][
0
].
stop
),
slice
(
p1
[
'slice'
][
1
].
start
,
p1
[
'slice'
][
1
].
stop
),
slice
(
p1
[
'slice'
][
2
].
start
,
p1
[
'slice'
][
2
].
stop
)
]
slice
(
p1
[
'slice'
][
2
].
start
,
p1
[
'slice'
][
2
].
stop
)
)
labSubvol
=
lab
[
labSlice
]
labSubvol
=
lab
[
labSlice
]
if
(
dilOnly
.
shape
==
labSubvol
.
shape
):
intersection
=
dilOnly
*
labSubvol
analysisVolume
[
labSlice
][
intersection
==
label2
]
=
n
+
1
analysisVolume
[
labSlice
][
intersection
==
label2
]
=
n
+
1
else
:
raise
Exception
(
...
...
@@ -302,11 +302,11 @@ def contactPoints(lab, contactPairs, returnContactZones=False, boundingBoxes=Non
if
returnContactZones
:
return
analysisVolume
else
:
return
spam
.
label
.
centresOfMass
(
analysisVolume
)
return
spam
.
label
.
centresOfMass
(
analysisVolume
)
def
labelledContacts
(
lab
,
maximumCoordinationNumber
=
20
):
def
labelledContacts
(
lab
,
maximumCoordinationNumber
=
20
):
"""
Uniquely names contacts based on grains.
...
...
Write
Preview
Supports
Markdown
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