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
4e8095db
Commit
4e8095db
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
some modifs + new prms
parent
365a513d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nutrimorph.py
+48
-10
48 additions, 10 deletions
nutrimorph.py
parameters.ini
+1
-0
1 addition, 0 deletions
parameters.ini
search_parameters.py
+1
-0
1 addition, 0 deletions
search_parameters.py
with
50 additions
and
10 deletions
nutrimorph.py
+
48
−
10
View file @
4e8095db
...
...
@@ -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_
.
im
save
(
f
"
{
save_images
}
\\
graph_
{
name_file
}
.png
"
)
pl_
.
save
fig
(
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
This diff is collapsed.
Click to expand it.
parameters.ini
+
1
−
0
View file @
4e8095db
...
...
@@ -72,6 +72,7 @@ condition
; TODO CHO, DIO, ...
duration
; TODO 1H, 3H, 1W, 3W, ...
statistical_analysis
:
True
[Somas]
soma_low_c
:
0.15
...
...
This diff is collapsed.
Click to expand it.
search_parameters.py
+
1
−
0
View file @
4e8095db
...
...
@@ -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
'
)
...
...
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