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
24399934
Commit
24399934
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
possibility to choose the boundaries for the histograms
parent
67980fc4
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
+18
-7
18 additions, 7 deletions
nutrimorph.py
parameters.ini
+18
-6
18 additions, 6 deletions
parameters.ini
search_parameters.py
+2
-0
2 additions, 0 deletions
search_parameters.py
with
38 additions
and
13 deletions
nutrimorph.py
+
18
−
7
View file @
24399934
...
...
@@ -98,9 +98,11 @@ method = None
hist_min_length
=
None
hist_step_length
=
None
number_of_bins_length
=
None
hist_bins_borders_length
=
None
hist_min_curvature
=
None
hist_step_curvature
=
None
number_of_bins_curvature
=
None
hist_bins_borders_curvature
=
None
with_plot
=
None
in_parallel
=
None
...
...
@@ -126,7 +128,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[:,
512:, 512
:] # 512 # 562 # Just for development
# image = image[:,
800:, 800
:] # 512 # 562 # Just for development
img_shape
=
image
.
shape
#
...
...
@@ -405,12 +407,21 @@ elapsed_time = tm_.gmtime(tm_.time() - start_time)
# Extract features
print
(
'
\n
--- Features Extraction
\n
'
)
# Prms
number_of_bins_length
=
int
(
number_of_bins_length
)
bins_length
=
np_
.
linspace
(
hist_min_length
,
hist_min_length
+
hist_step_length
*
number_of_bins_length
,
num
=
number_of_bins_length
)
bins_length
[
-
1
]
=
np_
.
inf
number_of_bins_curvature
=
int
(
number_of_bins_curvature
)
bins_curvature
=
np_
.
linspace
(
hist_min_curvature
,
hist_min_curvature
+
hist_step_curvature
*
number_of_bins_curvature
,
num
=
number_of_bins_curvature
)
bins_curvature
[
-
1
]
=
np_
.
inf
if
hist_bins_borders_length
is
None
:
number_of_bins_length
=
int
(
number_of_bins_length
)
bins_length
=
np_
.
linspace
(
hist_min_length
,
hist_min_length
+
hist_step_length
*
number_of_bins_length
,
num
=
number_of_bins_length
)
bins_length
[
-
1
]
=
np_
.
inf
else
:
bins_length
=
np_
.
array
(
hist_bins_borders_length
)
bins_length
[
-
1
]
=
np_
.
inf
if
hist_bins_borders_curvature
is
None
:
number_of_bins_curvature
=
int
(
number_of_bins_curvature
)
bins_curvature
=
np_
.
linspace
(
hist_min_curvature
,
hist_min_curvature
+
hist_step_curvature
*
number_of_bins_curvature
,
num
=
number_of_bins_curvature
)
bins_curvature
[
-
1
]
=
np_
.
inf
else
:
bins_curvature
=
np_
.
array
(
hist_bins_borders_curvature
)
bins_curvature
[
-
1
]
=
np_
.
inf
# DF creation
features_df
=
ge_
.
ExtractFeaturesInDF
(
somas
,
size_voxel_in_micron
,
bins_length
,
bins_curvature
,
ext_scales
)
...
...
This diff is collapsed.
Click to expand it.
parameters.ini
+
18
−
6
View file @
24399934
...
...
@@ -96,19 +96,31 @@ method : c
[Features Extraction]
; histograms of extensions lengths
hist_min_length
:
0
hist_min_length
#: 0
; in micron
; by default, 0
hist_step_length
:
6
hist_step_length
#: 6
; in micron
number_of_bins_length
:
5
number_of_bins_length
#: 5
; by default, 5
; extensions generally do not exceed 30 microns
; if the above parameters are set to None, you can directly use the boundaries of your choice for the histogram:
hist_bins_borders_length
:
(0,
0.5,
1,
5,
10,
50)
; histograms of extensions curvatures
hist_min_curvature
:
0
hist_step_curvature
:
6
number_of_bins_curvature
:
5
hist_min_curvature
#: 0
hist_step_curvature
#: 6
number_of_bins_curvature
#: 5
; if the above parameters are set to None, you can directly use the boundaries of your choice for the histogram:
hist_bins_borders_curvature
:
(0,
0.05,
0.3,
1,
10,
50)
[Program Running]
...
...
This diff is collapsed.
Click to expand it.
search_parameters.py
+
2
−
0
View file @
24399934
...
...
@@ -83,9 +83,11 @@ method = parameters['Frangi']['method']
hist_min_length
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_min_length
'
)
hist_step_length
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_step_length
'
)
number_of_bins_length
=
IfNotFloat
(
'
Features Extraction
'
,
'
number_of_bins_length
'
)
hist_bins_borders_length
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_bins_borders_length
'
)
hist_min_curvature
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_min_curvature
'
)
hist_step_curvature
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_step_curvature
'
)
number_of_bins_curvature
=
IfNotFloat
(
'
Features Extraction
'
,
'
number_of_bins_curvature
'
)
hist_bins_borders_curvature
=
IfNotFloat
(
'
Features Extraction
'
,
'
hist_bins_borders_curvature
'
)
# [Program running]
with_plot
=
parameters
.
getboolean
(
'
Program Running
'
,
'
with_plot
'
)
...
...
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