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
67980fc4
Commit
67980fc4
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
cleaning
parent
f0c8c483
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brick/component/extension.py
+0
-1
0 additions, 1 deletion
brick/component/extension.py
nutrimorph.py
+2
-11
2 additions, 11 deletions
nutrimorph.py
with
2 additions
and
12 deletions
brick/component/extension.py
+
0
−
1
View file @
67980fc4
...
...
@@ -192,7 +192,6 @@ class extension_t(glial_cmp_t):
result
=
image
.
copy
()
if
(
low
is
not
None
)
and
(
high
is
not
None
):
result
=
__HysterisisImage__
(
result
,
low
,
high
)
# np_.save("D:\\MorganeNadal\\img512enhanced_norm_hyst_2.npy", result)
if
selem
is
not
None
:
result
=
__MorphologicalCleaning__
(
result
,
selem
)
...
...
This diff is collapsed.
Click to expand it.
nutrimorph.py
+
2
−
11
View file @
67980fc4
...
...
@@ -126,17 +126,15 @@ 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[:, 512:, 512:] # 512 # 562 # Just for development
img_shape
=
image
.
shape
# np_.save("D:\\MorganeNadal\\img512.npy", image)
#
print
(
f
"
IMAGE: s.
{
img_shape
}
t.
{
image
.
dtype
}
m.
{
image
.
min
()
}
M.
{
image
.
max
()
}
"
)
# Intensity relative normalization (between 0 and 1).
image_for_soma
=
in_
.
IntensityNormalizedImage
(
image
)
image_for_ext
=
in_
.
IntensityNormalizedImage
(
image
)
# np_.save("D:\\MorganeNadal\\img512norm.npy", image_for_ext)
print
(
f
"
NRM-IMG: t.
{
image_for_soma
.
dtype
}
m.
{
image_for_soma
.
min
()
:
.
2
f
}
M.
{
image_for_soma
.
max
()
:
.
2
f
}
"
)
...
...
@@ -213,13 +211,10 @@ enhanced_ext, ext_scales = extension_t.EnhancedForDetection(
method
,
in_parallel
=
in_parallel
)
# np_.save("D:\\MorganeNadal\\img512enhanced.npy", enhanced_ext)
elapsed_time
=
tm_
.
gmtime
(
tm_
.
time
()
-
start_time
)
print
(
f
"
Elapsed Time=
{
tm_
.
strftime
(
'
%Hh %Mm %Ss
'
,
elapsed_time
)
}
\n
"
)
enhanced_ext
=
in_
.
IntensityNormalizedImage
(
enhanced_ext
)
# np_.save("D:\\MorganeNadal\\img512enhanced_norm.npy", enhanced_ext)
# Creation of the enhanced maps
ext_nfo
[
"
coarse_map
"
]
=
extension_t
.
CoarseMap
(
enhanced_ext
,
ext_low_c
,
ext_high_c
,
ext_selem_pixel_c
)
# seuillage
...
...
@@ -231,8 +226,6 @@ ext_nfo["lmp"], n_extensions = ms_.label(ext_nfo["map"], return_num=True)
# ext_nfo["lmp"] = relabel_sequential(ext_lmp)[0]
# n_extensions = ext_nfo["lmp"].max()
# np_.save("D:\\MorganeNadal\\img512enhanced_norm_hyst_morpho_2.npy", ext_nfo["lmp"])
extensions
=
tuple
(
extension_t
().
FromMap
(
ext_nfo
[
"
lmp
"
],
ext_scales
,
uid
)
for
uid
in
range
(
1
,
n_extensions
+
1
))
...
...
@@ -372,8 +365,6 @@ print(f"\nElapsed Time={tm_.strftime('%Hh %Mm %Ss', elapsed_time)}")
if
with_plot
:
pl_
.
show
()
# np_.save("D:\\MorganeNadal\\img512final_2.npy", som_nfo['soma_w_ext_lmp'])
po_
.
MaximumIntensityProjectionZ
(
som_nfo
[
'
soma_w_ext_lmp
'
])
# --- Extract all the extensions of all somas as a graph
...
...
@@ -423,7 +414,7 @@ bins_curvature[-1] = np_.inf
# DF creation
features_df
=
ge_
.
ExtractFeaturesInDF
(
somas
,
size_voxel_in_micron
,
bins_length
,
bins_curvature
,
ext_scales
)
features_df
.
to_csv
(
"
D:
\\
MorganeNadal
\\
M2 report
\\
features
_512_
.csv
"
)
features_df
.
to_csv
(
"
...
\\
features.csv
"
)
#
elapsed_time
=
tm_
.
gmtime
(
tm_
.
time
()
-
start_time
)
...
...
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