Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NutriMorph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEBREUVE Eric
NutriMorph
Commits
b42d61cc
Commit
b42d61cc
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
small corrections
parent
72ba3dea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brick/processing/graph_extraction.py
+3
-11
3 additions, 11 deletions
brick/processing/graph_extraction.py
nutrimorph.py
+4
-4
4 additions, 4 deletions
nutrimorph.py
with
7 additions
and
15 deletions
brick/processing/graph_extraction.py
+
3
−
11
View file @
b42d61cc
...
...
@@ -34,7 +34,6 @@ import numpy as np_
from
brick.component.soma
import
soma_t
from
brick.general.type
import
array_t
from
sklgraph.skl_graph
import
skl_graph_t
from
typing
import
Tuple
,
Dict
,
Union
,
Any
...
...
@@ -75,15 +74,8 @@ def FindGraphsRootWithEdges(soma: soma_t, ext_nfo: Dict[str, Union[array_t, Any]
for
k
in
(
-
1
,
0
,
1
)
if
i
!=
0
or
j
!=
0
or
k
!=
0
)
# soma_contour_sites = set(
# (soma.contour_points[0] + i, soma.contour_points[1] + j, soma.contour_points[2] + k)
# for i in (-1, 0, 1)
# for j in (-1, 0, 1)
# for k in (-1, 0, 1)
# if i != 0 or j != 0 or k != 0
# Find the intersection between the extended root node candidate and the soma contour points
intersections
=
soma
_
contour_
sites
.
intersection
(
root_sites
)
intersections
=
set
(
soma
.
contour_
points
)
.
intersection
(
root_sites
)
# if the graph root sites are included in the soma extensions sites (non-nul intersection):
if
len
(
intersections
)
>
0
:
...
...
@@ -91,10 +83,10 @@ def FindGraphsRootWithEdges(soma: soma_t, ext_nfo: Dict[str, Union[array_t, Any]
root_nodes
[
ext_uid
]
=
root_node
## By construction, only one root node possible for an ext
return
root_nodes
return
root_nodes
# TODO: find out why there are less root points than extensions !!
def
FindGraphsRootWithNodes
(
soma
:
soma_t
)
->
lis
t
:
def
FindGraphsRootWithNodes
(
soma
:
soma_t
)
->
dic
t
:
"""
Find the roots of the {extension+connexion} graphs to be lined to the soma.
Add a key
"
root
"
(bool) in the dict of nodes attributes.
...
...
This diff is collapsed.
Click to expand it.
nutrimorph.py
+
4
−
4
View file @
b42d61cc
...
...
@@ -117,7 +117,7 @@ image = in_.ImageVerification(image, channel)
# iv_.image_verification(image, channel) # -> PySide2 user interface # TODO: must return the modified image!
# /!\ conflicts between some versions of PySide2 and Python3
image
=
image
[:,
800
:,
800
:]
# 512 # 562 # Just for development
image
=
image
[:,
512
:,
512
:]
# 512 # 562 # Just for development
img_shape
=
image
.
shape
#
...
...
@@ -344,7 +344,7 @@ if with_plot:
pl_
.
show
()
po_
.
MaximumIntensityProjectionZ
(
som_nfo
[
'
soma_w_ext_lmp
'
])
po_
.
MaximumIntensityProjectionZ
(
ext_nfo
[
'
lmp_soma
'
])
#
po_.MaximumIntensityProjectionZ(ext_nfo['lmp_soma'])
# --- Extract all the extensions of all somas as a graph
print
(
'
\n
--- Graph extraction
'
)
...
...
@@ -378,8 +378,8 @@ for soma in somas:
soma
.
skl_graph
.
add_edge
(
node
,
soma_node
,
root
=
True
)
# print(node, "<->", soma_node,': Done')
nx_
.
draw_networkx
(
soma
.
skl_graph
)
pl_
.
show
(
block
=
True
)
#
nx_.draw_networkx(soma.skl_graph)
#
pl_.show(block=True)
if
with_plot
:
nx_
.
draw_networkx
(
soma
.
skl_graph
)
...
...
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
register
or
sign in
to comment