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
baae4068
Commit
baae4068
authored
5 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
wrote fct for relative intensity image normalization + refractoring
parent
3ff4cecf
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
brick/general/feedback.py
+4
-4
4 additions, 4 deletions
brick/general/feedback.py
brick/processing/input.py
+22
-10
22 additions, 10 deletions
brick/processing/input.py
nutrimorph.py
+2
-2
2 additions, 2 deletions
nutrimorph.py
with
28 additions
and
16 deletions
brick/general/feedback.py
+
4
−
4
View file @
baae4068
...
@@ -57,10 +57,10 @@ def PlotSomas(somas: Sequence[soma_t], som_nfo: dict, axes: dict) -> None:
...
@@ -57,10 +57,10 @@ def PlotSomas(somas: Sequence[soma_t], som_nfo: dict, axes: dict) -> None:
for
soma
in
somas
:
for
soma
in
somas
:
axes
[
soma
.
uid
]
=
ot_
.
PlotLMap
(
som_nfo
[
"
lmp
"
],
labels
=
soma
.
uid
)
axes
[
soma
.
uid
]
=
ot_
.
PlotLMap
(
som_nfo
[
"
lmp
"
],
labels
=
soma
.
uid
)
pl_
.
title
(
f
"
Soma.
{
soma
.
uid
}
"
)
pl_
.
title
(
f
"
Soma.
{
soma
.
uid
}
"
)
pl_
.
matshow
(
som_nfo
[
"
influence_map
"
].
max
(
axis
=
0
)),
pl_
.
title
(
"
Soma Influencess
"
)
#
pl_.matshow(som_nfo["influence_map"].max(axis=0)), pl_.title("Soma Influencess")
pl_
.
show
(
block
=
True
)
#
pl_.show(block=True)
pl_
.
matshow
(
som_nfo
[
"
dist_to_closest
"
].
max
(
axis
=
0
)),
pl_
.
title
(
"
Soma Distances
"
)
#
pl_.matshow(som_nfo["dist_to_closest"].max(axis=0)), pl_.title("Soma Distances")
pl_
.
show
(
block
=
True
)
#
pl_.show(block=True)
def
PlotExtensions
(
def
PlotExtensions
(
...
...
This diff is collapsed.
Click to expand it.
brick/processing/input.py
+
22
−
10
View file @
baae4068
...
@@ -68,21 +68,33 @@ def ImageVerification(image, channel):
...
@@ -68,21 +68,33 @@ def ImageVerification(image, channel):
# print('WARNING. The 3 RGB color channels were selected in the parameters but the image has only one channel.')
# print('WARNING. The 3 RGB color channels were selected in the parameters but the image has only one channel.')
def
NormalizedImage
(
image
:
array_t
)
->
array_t
:
def
Intensity
NormalizedImage
(
image
:
array_t
)
->
array_t
:
#
#
print
(
print
(
'
Relative Intensity Normalization between 0 and 1 (Not a standardization). Need to reevaluate the parameters !!!
'
)
"
This normalization does not bring anything; left as is for now to avoid the need for changing prms
"
)
nonextreme_values
=
image
[
np_
.
logical_and
(
image
>
0.0
,
image
<
image
.
max
())]
if
nonextreme_values
.
size
>
0
:
value_max
=
image
.
astype
(
np_
.
float32
).
max
()
nonextreme_avg
=
nonextreme_values
.
mean
()
value_min
=
image
.
astype
(
np_
.
float32
).
min
()
result
=
image
.
astype
(
np_
.
float32
)
/
nonextreme_avg
else
:
result
=
(
image
.
astype
(
np_
.
float32
)
-
value_min
)
/
(
value_max
-
value_min
)
result
=
image
.
astype
(
np_
.
float32
)
return
result
return
result
# print(
# "This normalization does not bring anything; left as is for now to avoid the need for changing prms"
# )
# nonextreme_values = image[np_.logical_and(image > 0.0, image < image.max())]
#
# if nonextreme_values.size > 0:
# nonextreme_avg = nonextreme_values.mean()
# result = image.astype(np_.float32) / nonextreme_avg
# else:
# result = image.astype(np_.float32)
#
# return result
def
MetricNormalizedImage
(
image
:
array_t
)
->
array_t
:
# TODO
#
print
(
'
Image metric in converted to micrometers.
'
)
def
DijkstraCosts
(
image
:
array_t
,
som_map
:
array_t
,
ext_map
:
array_t
)
->
array_t
:
def
DijkstraCosts
(
image
:
array_t
,
som_map
:
array_t
,
ext_map
:
array_t
)
->
array_t
:
#
#
...
...
This diff is collapsed.
Click to expand it.
nutrimorph.py
+
2
−
2
View file @
baae4068
...
@@ -106,8 +106,8 @@ img_shape = image.shape
...
@@ -106,8 +106,8 @@ img_shape = image.shape
#
#
print
(
f
"
IMAGE: s.
{
img_shape
}
t.
{
image
.
dtype
}
m.
{
image
.
min
()
}
M.
{
image
.
max
()
}
"
)
print
(
f
"
IMAGE: s.
{
img_shape
}
t.
{
image
.
dtype
}
m.
{
image
.
min
()
}
M.
{
image
.
max
()
}
"
)
image_for_soma
=
in_
.
NormalizedImage
(
image
)
image_for_soma
=
in_
.
Intensity
NormalizedImage
(
image
)
image_for_ext
=
in_
.
NormalizedImage
(
image
)
image_for_ext
=
in_
.
Intensity
NormalizedImage
(
image
)
print
(
f
"
NRM-IMG: t.
{
image_for_soma
.
dtype
}
m.
{
image_for_soma
.
min
()
:
.
2
f
}
M.
{
image_for_soma
.
max
()
:
.
2
f
}
"
)
print
(
f
"
NRM-IMG: t.
{
image_for_soma
.
dtype
}
m.
{
image_for_soma
.
min
()
:
.
2
f
}
M.
{
image_for_soma
.
max
()
:
.
2
f
}
"
)
# --- Initialization
# --- Initialization
...
...
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