Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IAH public
DeProj
Commits
a8e0a7eb
Commit
a8e0a7eb
authored
Jul 16, 2020
by
Jean-Yves TINEVEZ
Browse files
Add methods to plot cell area and perimeter.
parent
5d9ae4db
Changes
5
Hide whitespace changes
Inline
Side-by-side
RunExample.m
View file @
a8e0a7eb
...
...
@@ -71,8 +71,9 @@ dpr = deproj.from_heightmap( ...
%% Plot morphological parameters.
close
all
plot_sizes
(
dpr
);
% plot_fit_plane( dpr );
% plot_fit_ellipse( dpr );
[
hf
,
ax1
,
ax2
,
ax3
]
=
plot_curvatures
(
dpr
);
%
plot_curvatures( dpr );
src/@deproj/add_plot_area.m
0 → 100644
View file @
a8e0a7eb
function
hts
=
add_plot_area
(
obj
,
ax
)
%ADD_PLOT_AREA Add the tissue plot colored with the cell area.
epicells
=
obj
.
epicells
;
areas
=
vertcat
(
epicells
.
area
);
hts
=
add_plot_variable
(
obj
,
areas
,
ax
);
end
src/@deproj/add_plot_perimeter.m
0 → 100644
View file @
a8e0a7eb
function
hts
=
add_plot_perimeter
(
obj
,
ax
)
%ADD_PLOT_PERIMETER Add the tissue plot colored with the cell perimeter.
epicells
=
obj
.
epicells
;
perims
=
vertcat
(
epicells
.
perimeter
);
hts
=
add_plot_variable
(
obj
,
perims
,
ax
);
end
src/@deproj/deproj.m
View file @
a8e0a7eb
...
...
@@ -34,6 +34,9 @@ classdef deproj
% Figure with the local curvaure for a collection of epicells.
[
hf
,
ax1
,
ax2
,
ax3
]
=
plot_curvatures
(
obj
,
scale_bar_length
)
% Figure with the cells area and perimeter.
[
hf
,
ax1
,
ax2
]
=
plot_sizes
(
obj
,
scale_bar_length
)
%% Helpers.
% They are public in case of.
...
...
@@ -69,6 +72,12 @@ classdef deproj
% Add the tissue plot colored with the second principal curvature.
hts
=
add_plot_curvature_k2
(
obj
,
ax
)
% Add the tissue plot colored with the cell area.
hts
=
add_plot_area
(
obj
,
ax
)
% Add the tissue plot colored with the cell perimeter.
hts
=
add_plot_perimeter
(
obj
,
ax
)
end
...
...
src/@deproj/plot_sizes.m
0 → 100644
View file @
a8e0a7eb
function
[
hf
,
ax1
,
ax2
]
=
plot_sizes
(
obj
,
scale_bar_length
)
%PLOT_SIZES Figure with the cells area and perimeter.
if
nargin
<
2
scale_bar_length
=
10
;
end
hf
=
figure
(
'Position'
,
[
1204
20
600
650
]
);
ax1
=
subplot
(
2
,
1
,
1
);
hold
on
axis
equal
add_plot_area
(
obj
,
ax1
);
colorbar
ax2
=
subplot
(
2
,
1
,
2
);
hold
on
axis
equal
add_plot_perimeter
(
obj
,
ax2
);
colorbar
add_plot_scalebar
(
obj
,
scale_bar_length
,
ax2
);
axis
(
ax1
,
'off'
)
axis
(
ax2
,
'off'
)
title
(
ax1
,
sprintf
(
'Cell area (%s²)'
,
obj
.
units
),
...
'FontWeight'
,
'normal'
,
...
'Interpreter'
,
'none'
)
title
(
ax2
,
sprintf
(
'Cell perimeter (%s)'
,
obj
.
units
),
...
'FontWeight'
,
'normal'
,
...
'Interpreter'
,
'none'
)
linkaxes
(
[
ax2
ax1
]
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment