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
ca68c425
Commit
ca68c425
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
corrected some features
parent
09ae9de9
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
nutrimorph.py
+5
-5
5 additions, 5 deletions
nutrimorph.py
sklgraph/skl_fgraph.py
+16
-4
16 additions, 4 deletions
sklgraph/skl_fgraph.py
with
21 additions
and
9 deletions
nutrimorph.py
+
5
−
5
View file @
ca68c425
...
...
@@ -120,7 +120,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
[:,
512
:,
512
:]
# 512 # 562 # Just for development
image
=
image
[:,
800
:,
800
:]
# 512 # 562 # Just for development
img_shape
=
image
.
shape
#
...
...
@@ -415,13 +415,13 @@ for soma in somas:
N_primary_ext
=
len
(
soma
.
graph_roots
)
# number of primary edges = linked to the soma except the constructed ones from node soma to the roots
N_sec_ext
=
N_ext
-
N_primary_ext
# number of secondary edges = not linked to the soma.
highest_degree
=
soma
.
skl_graph
.
fct
_degree
# highest degree of the nodes except the soma
highest_degree
=
soma
.
skl_graph
.
max
_degree
# highest degree of the nodes except the soma
highest_degree_w_node
=
soma
.
skl_graph
.
highest_degree_w_nodes
# highest degree of the nodes with the node coordinates except the soma
N_nodes_of_highest_degree
=
len
(
highest_degree_w_node
[
1
])
# number of nodes of highest degree
# min, mean and max degrees of non-leaves nodes
min_degree
=
soma
.
skl_graph
.
fct
_degree_except_leaves
(
min
)
mean_degree
=
soma
.
skl_graph
.
fct
_degree_except_leaves
(
np_
.
mean
)
max_degree
=
soma
.
skl_graph
.
fct
_degree_except_leaves
(
max
)
min_degree
=
soma
.
skl_graph
.
min
_degree_except_leaves
mean_degree
=
soma
.
skl_graph
.
mean
_degree_except_leaves
max_degree
=
soma
.
skl_graph
.
max
_degree_except_leaves
print
(
f
"
\n
-- Extensions
\n
"
...
...
This diff is collapsed.
Click to expand it.
sklgraph/skl_fgraph.py
+
16
−
4
View file @
ca68c425
...
...
@@ -49,12 +49,24 @@ class skl_graph_t(skl_nfgraph_t):
return
self
.
number_of_edges
()
@property
def
fct
_degree
(
self
,
fct
:
callable
=
max
)
->
int
:
return
fct
(
list
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
)
)
def
max
_degree
(
self
)
->
int
:
return
max
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
)
@property
def
fct_degree_except_leaves
(
self
,
fct
:
callable
=
max
)
->
int
:
return
fct
(
list
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
and
degree
!=
1
))
def
max_degree_except_leaves
(
self
)
->
int
:
return
max
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
and
degree
!=
1
)
@property
def
min_degree_except_leaves
(
self
)
->
int
:
return
min
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
and
degree
!=
1
)
@property
def
mean_degree_except_leaves
(
self
)
->
int
:
return
np_
.
mean
(
list
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
and
degree
!=
1
))
@property
def
median_degree_except_leaves
(
self
)
->
int
:
return
np_
.
median
(
list
(
degree
for
node
,
degree
in
self
.
degree
if
"
S
"
not
in
node
and
degree
!=
1
))
@property
def
highest_degree_w_nodes
(
self
)
->
Tuple
[
int
,
List
[
str
]]:
...
...
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