Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 445f2be8 authored by DEBREUVE Eric's avatar DEBREUVE Eric
Browse files

refactoring

parent 2e524b41
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ __material__/ ...@@ -7,6 +7,8 @@ __material__/
__runtime__/ __runtime__/
__version__/ __version__/
__when__.txt
data/ data/
mprofile_*.dat mprofile_*.dat
......
...@@ -68,8 +68,8 @@ def ShortestPathFromToN( ...@@ -68,8 +68,8 @@ def ShortestPathFromToN(
point: site_h, point: site_h,
costs: array_t, costs: array_t,
candidate_points_fct: Callable, candidate_points_fct: Callable,
max_straight_sq_dist: cy_.double = np_.inf, max_straight_sq_dist: float = np_.inf,
) -> Tuple[site_path_h, cy_.double]: ) -> Tuple[site_path_h, float]:
# #
candidate_points, candidate_indexing = candidate_points_fct( candidate_points, candidate_indexing = candidate_points_fct(
point, max_straight_sq_dist point, max_straight_sq_dist
......
...@@ -126,7 +126,7 @@ class extension_t(glial_cmp_t): ...@@ -126,7 +126,7 @@ class extension_t(glial_cmp_t):
) )
@staticmethod @staticmethod
def ExtensionWithSite( def ExtensionContainingSite(
extensions: Sequence[extension_t], site: site_h extensions: Sequence[extension_t], site: site_h
) -> Optional[extension_t]: ) -> Optional[extension_t]:
# #
......
...@@ -36,8 +36,6 @@ from brick.general.type import array_t, np_array_picker_h, py_array_picker_h, si ...@@ -36,8 +36,6 @@ from brick.general.type import array_t, np_array_picker_h, py_array_picker_h, si
from abc import abstractmethod from abc import abstractmethod
from typing import Dict, List, Optional, Tuple from typing import Dict, List, Optional, Tuple
import numpy as np_
class glial_cmp_t: class glial_cmp_t:
# #
......
...@@ -34,9 +34,6 @@ from brick.general.type import array_t ...@@ -34,9 +34,6 @@ from brick.general.type import array_t
import numpy as np_ import numpy as np_
invalid_n_neighbors_c = 27 # Must be positive and higher (strictly) than
# the max number of neighbors in a skeleton
shifts_of_26_neighbors_c = tuple( shifts_of_26_neighbors_c = tuple(
(i, j, k) (i, j, k)
for i in (-1, 0, 1) for i in (-1, 0, 1)
...@@ -44,6 +41,8 @@ shifts_of_26_neighbors_c = tuple( ...@@ -44,6 +41,8 @@ shifts_of_26_neighbors_c = tuple(
for k in (-1, 0, 1) for k in (-1, 0, 1)
if i != 0 or j != 0 or k != 0 # take every direct neighbors except itself if i != 0 or j != 0 or k != 0 # take every direct neighbors except itself
) )
# Must be positive and higher (strictly) than the max number of neighbors
invalid_n_neighbors_c = shifts_of_26_neighbors_c.__len__() + 1
def PartLMap(map_: array_t) -> array_t: def PartLMap(map_: array_t) -> array_t:
......
...@@ -235,7 +235,7 @@ while should_look_for_connections: ...@@ -235,7 +235,7 @@ while should_look_for_connections:
max_straight_sq_dist=max_straight_sq_dist_c, max_straight_sq_dist=max_straight_sq_dist_c,
) )
if length <= max_weighted_length_c: if length <= max_weighted_length_c:
tgt_extenstion = extension_t.ExtensionWithSite(extensions, path[-1]) tgt_extenstion = extension_t.ExtensionContainingSite(extensions, path[-1])
cn_.ValidateConnection(tgt_extenstion, extension, path, dijkstra_costs) cn_.ValidateConnection(tgt_extenstion, extension, path, dijkstra_costs)
should_look_for_connections = True should_look_for_connections = True
print(": Made") print(": Made")
......
...@@ -33,6 +33,7 @@ import skimage.morphology as mp_ ...@@ -33,6 +33,7 @@ import skimage.morphology as mp_
data_path = "./data/DIO_6H_6_1.70bis_2.2_3.tif" data_path = "./data/DIO_6H_6_1.70bis_2.2_3.tif"
channel = 1
with_plot = True with_plot = True
soma_low_c = 0.15 soma_low_c = 0.15
......
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