Mentions légales du service

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

some modifs + new prms

parent 365a513d
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,7 @@ data_path = None
channel = None
save_images = None
size_voxel_in_micron = None
statistical_analysis = None
soma_low_c = None
soma_high_c = None
soma_selem_micron_c = None
......@@ -863,7 +864,7 @@ def NutriMorph(data_path: str,
)
# Keep the connexion only if inferior to the allowed max weighted distance
if length is not None:
if path.__len__() > 0:
length = in_.ToPixel(length, size_voxel_in_micron)
if length <= max_weighted_length_c:
# Validate and update all the fields + dilate again the whole extension
......@@ -1007,8 +1008,9 @@ def NutriMorph(data_path: str,
soma.skl_graph.add_edge(node, soma_node, root=True)
if save_images is not None:
nx_.draw_networkx(soma.skl_graph)
pl_.imsave(f"{save_images}\\graph_{name_file}.png")
pl_.savefig(f"{save_images}\\graph_{name_file}_soma{soma.uid}.png")
pl_.close()
print(": Done")
......@@ -1085,11 +1087,47 @@ if __name__ == '__main__':
## TODO + Error in best fitting ellipsoid : JTJ is singular.
print(f"WARNING: Error in the running of NutriMorph on {name_file}")
# Save to .csv in the parent repository
concatenated_features_df.to_csv(f"{data_path}_features.csv")
# --- TODO Clustering with this df and module features_analysis.py
# K-means with all the features
# PCA with all the features
# Select Discriminant features by statistical analysis
# K-means with selected features
# PCA with selected features
concatenated_features_df.to_csv(f"{data_path}\\features.csv")
# --- TODO Clustering with this df and module features_analysis.py
if statistical_analysis:
## -- K-means with all the features (2 conditions)
## Between the two conditions, regardless the duration of experiment (2 conditions, all durations)
# kmeans = fa_.KmeansOnDF(concatenated_features_df, nb_clusters=(2,), elbow=True, intracluster_var=True)
## Between the two conditions, for each duration (2 conditions, 3 durations)
# groupby_duration = concatenated_features_df.groupby("Duration")
# for duration, values in groupby_duration:
# kmeans = fa_.KmeansOnDF(values, nb_clusters=(2,), elbow=True, intracluster_var=True)
## -- PCA with all the features
## Between the two conditions, regardless the duration of experiment (2 conditions, all durations)
# TODO pca = fa_.PCAOnDF(concatenated_features_df)
## Between the two conditions, for each duration (2 conditions, 3 durations)
# for duration, values in groupby_duration:
# pca = fa_.PCAOnDF(values)
## -- Select Discriminant features by statistical analysis
# TODO filtered_df = SelectFeatures(concatenated_features_df)
## -- K-means with selected features
## Between the two conditions, regardless the duration of experiment (2 conditions, all durations)
# filtered_kmeans = fa_.KmeansOnDF(filtered_df, nb_clusters=(2,), elbow=True, intracluster_var=True)
## Between the two conditions, for each duration (2 conditions, 3 durations)
# filtered_groupby_duration = filtered_df.groupby("Duration")
# for duration, values in filtered_groupby_duration:
# filtered_kmeans = fa_.KmeansOnDF(values, nb_clusters=(2,), elbow=True, intracluster_var=True)
## -- PCA with selected features
## Between the two conditions, regardless the duration of experiment (2 conditions, all durations)
# TODO pca = fa_.PCAOnDF(filtered_df)
## Between the two conditions, for each duration (2 conditions, 3 durations)
# for duration, values in filtered_groupby_duration:
# pca = fa_.PCAOnDF(values)
\ No newline at end of file
......@@ -72,6 +72,7 @@ condition
; TODO CHO, DIO, ...
duration
; TODO 1H, 3H, 1W, 3W, ...
statistical_analysis : True
[Somas]
soma_low_c : 0.15
......
......@@ -54,6 +54,7 @@ channel = parameters['Input']['channel']
size_voxel_in_micron = IfNotFloat('Input', 'size_voxel_in_micron')
crop_image = IfNotFloat('Input', 'crop_image')
save_images = parameters['Input']['save_images']
statistical_analysis = parameters.getboolean('Input', 'statistical_analysis')
# [Somas]
soma_low_c = IfNotFloat('Somas', 'soma_low_c')
......
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