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
801bc197
Commit
801bc197
authored
4 years ago
by
NADAL Morgane
Browse files
Options
Downloads
Patches
Plain Diff
Changed MIP fct (not using SimpleITK anymore)
parent
856559c7
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Create graphs and change the root search
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brick/processing/plot.py
+3
-9
3 additions, 9 deletions
brick/processing/plot.py
nutrimorph.py
+21
-1
21 additions, 1 deletion
nutrimorph.py
with
24 additions
and
10 deletions
brick/processing/plot.py
+
3
−
9
View file @
801bc197
...
...
@@ -41,18 +41,12 @@ import mpl_toolkits.mplot3d as p3_
import
numpy
as
np_
import
skimage.measure
as
ms_
import
SimpleITK
as
sitk
def
MaximumIntensityProjectionZ
(
img
:
array_t
,
cmap
:
str
=
'
tab20
'
,
output_image_file_name
:
str
=
None
)
->
None
:
def
MaximumIntensityProjectionZ
(
img
:
array_t
,
cmap
:
str
=
'
tab20
'
,
axis
:
int
=
0
,
output_image_file_name
:
str
=
None
)
->
None
:
"""
Maximum Image Projection on the Z axis.
"""
#
image
=
sitk
.
GetImageFromArray
(
img
)
# image_size = image.GetSize()
# print('Image Size = ', image_size)
projection
=
sitk
.
MaximumProjection
(
image
,
2
)
np_img
=
sitk
.
GetArrayFromImage
(
projection
)
pl_
.
imshow
(
np_img
[
0
,
:,
:],
cmap
=
cmap
)
xy
=
np_
.
amax
(
img
,
axis
=
axis
)
pl_
.
imshow
(
xy
,
cmap
=
cmap
)
pl_
.
show
(
block
=
True
)
if
output_image_file_name
is
not
None
:
pl_
.
imsave
(
output_image_file_name
,
np_img
[
0
,
:,
:],
cmap
=
cmap
)
...
...
This diff is collapsed.
Click to expand it.
nutrimorph.py
+
21
−
1
View file @
801bc197
...
...
@@ -342,7 +342,7 @@ po_.MaximumIntensityProjectionZ(ext_nfo['lmp_ext'])
# Extract the graph of each extension of a soma
print
(
'
\n
--- Graph extraction
\n
'
)
ext_map
=
skl_map_t
.
FromShapeMap
(
ext_nfo
[
'
lmp_ext
'
],
store_widths
=
True
,
skeletonize
=
False
,
do_post_thinning
=
False
)
ext_map
=
skl_map_t
.
FromShapeMap
(
ext_nfo
[
'
lmp_ext
'
],
store_widths
=
True
,
skeletonize
=
False
)
#
, do_post_thinning=
True
ext_skl_graph
=
skl_graph_t
.
FromSkeleton
(
ext_map
)
# --- Some info about the skeleton graphs
...
...
@@ -381,3 +381,23 @@ ext_skl_graph = ge_.FindGraphsRoot(somas, ext_skl_graph)
elapsed_time
=
tm_
.
gmtime
(
tm_
.
time
()
-
start_time
)
print
(
f
"
\n
Elapsed Time=
{
tm_
.
strftime
(
'
%Hh %Mm %Ss
'
,
elapsed_time
)
}
"
)
print
(
f
"
DONE:
{
tm_
.
strftime
(
'
%a, %b %d %Y @ %H
:
%
M
:
%
S
'
)
}
"
)
# for node_id,node_id2, edge_nfo in ext_skl_graph.edges.data('as_edge_t'):
# ... if (ext_skl_graph.degree[node_id] == 1) or (ext_skl_graph.degree[node_id2] == 1):
# ... print(edge_nfo.sites)
# # Pour un soma donne
# # primary_extension_sites = tuple(set(zip(*extension.sites) for extension in soma.extensions)
# primary_extension_uids = tuple(extension.uid for extension in soma.extensions)
# for node_id,node_id2, edge_nfo in ext_skl_graph.edges.data('as_edge_t'):
# if (ext_skl_graph.degree[node_id] == 1) or (ext_skl_graph.degree[node_id2] == 1):
# ext_uid = np_.unique(ext_nfo['lmp'][edge_nfo.sites])[1]
# if ext_uid in primary_extension_uids:
# if ext_skl_graph.degree[node_id] == 1:
# root_node = node_id
# else:
# root_node = node_id2
# # print(edge_nfo.sites)
# # edge_sites = set(zip(*edge_nfo.sites))
# # intersections = map(in)
\ No newline at end of file
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