Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b42d61cc authored by NADAL Morgane's avatar NADAL Morgane
Browse files

small corrections

parent 72ba3dea
No related branches found
No related tags found
No related merge requests found
......@@ -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) -> list:
def FindGraphsRootWithNodes(soma: soma_t) -> dict:
"""
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.
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment