Mentions légales du service

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

curvature and torsion coorection + lengths of edges in micron

parent d832a4a9
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,6 @@ def polyToParams3D(ellipsoid_coef: array_t, spherical_coordinates: bool = False,
R3S = R3 / s1
(el, ec) = eig(R3S)
print(el, ec)
# Sorting in croissant order of the eigenvalues and eigenvectors
sorting_vec = np_.argsort(el)
......
......@@ -353,7 +353,6 @@ def ExtractFeaturesInDF(somas, size_voxel_in_micron: list, number_of_bins: int,
#
# Curvature and Torsion
curvatures, torsions = soma.skl_graph.curvature_and_torsion(size_voxel=size_voxel_in_micron)
print(curvatures, "\n", torsions)
#
min_curvature = min(curvatures)
max_curvature = max(curvatures)
......
......@@ -405,12 +405,9 @@ print('\n--- Features Extraction\n')
# Prms
number_of_bins = int(number_of_bins)
max_range = hist_step * number_of_bins - hist_min_length
# DF creation # TODO Delete ext_lengths from df
# DF creation
features_df = ge_.ExtractFeaturesInDF(somas, size_voxel_in_micron, number_of_bins, max_range, hist_min_length, ext_scales)
features_df.to_csv("D:\\MorganeNadal\\M2 report\\feat_512_3.csv")
# TODO FRANGI: CURVATURE & TORSION EXTENSIONS
features_df.to_csv("D:\\MorganeNadal\\M2 report\\feat_512_4.csv")
#
elapsed_time = tm_.gmtime(tm_.time() - start_time)
......
......@@ -102,9 +102,9 @@ class edge_t:
sites_as_array = np_.array(self.sites)
segments = np_.diff(sites_as_array, axis=1)
# segmentsT = segments.transpose()
# sq_lengths = (segmentsT.dot(np_.diag(size_voxel)).dot(segments)).sum(axis=0)
sq_lengths = (segments ** 2).sum(axis=0)
segmentsT = segments.transpose()
sq_lengths = ((segmentsT.dot(np_.diag(size_voxel)).dot(segments))**2).sum(axis=0)
# sq_lengths = (segments ** 2).sum(axis=0)
lengths = np_.sqrt(sq_lengths)
length = lengths.sum().item()
......@@ -187,7 +187,7 @@ class edge_t:
c = derivates["x2"][idx][1] * derivates["x1"][idx][0] - derivates["x1"][idx][1] * derivates["x2"][idx][0]
d = (derivates["x1"][idx][0]**2 + derivates["x2"][idx][0]**2 + derivates["x3"][idx][0]**2)**(3/2)
if d != 0:
k = (np_.sqrt(a**2 + b**2 + c**2)) / d
k = np_.abs((np_.sqrt(a**2 + b**2 + c**2)) / d)
else:
k = 0
......@@ -200,7 +200,6 @@ class edge_t:
curvatures.append(k)
torsions.append(t)
# print(curvatures, "\n", torsions)
return curvatures, torsions
......
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