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
e6bcc04b
Commit
e6bcc04b
authored
Jul 07, 2020
by
Jean-Yves TINEVEZ
Browse files
Set the colorbar properly on the ellipse fit figure.
parent
06b7ea29
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/@deproj/add_ellipse_variable.m
View file @
e6bcc04b
function
hts
=
add_ellipse_variable
(
obj
,
values
,
ax
)
function
hts
=
add_ellipse_variable
(
obj
,
values
,
cmap
,
ax
)
%ADD_ELLIPSE_VARIABLE Plots the ellipses, colored by the specified values.
epicells
=
obj
.
epicells
;
n_objects
=
numel
(
epicells
);
hts
=
NaN
(
n_objects
,
1
);
hts
=
NaN
(
2
*
n_objects
,
1
);
minv
=
min
(
values
);
maxv
=
max
(
values
);
colors
=
hsv
(
256
);
colors
=
colormap
(
cmap
);
idx
=
@
(
v
)
1
+
round
(
(
v
-
minv
)/(
maxv
-
minv
)
*
(
size
(
colors
,
1
)
-
1
)
);
for
i
=
1
:
n_objects
o
=
epicells
(
i
);
h
=
o
.
plot_ellipse_3d
(
23
,
ax
);
h1
=
o
.
plot_ellipse_3d
(
23
,
ax
);
h2
=
o
.
plot_ellipse_3d
(
3
,
ax
);
hts
(
i
)
=
h
;
hts
(
2
*
i
-
1
)
=
h1
;
hts
(
2
*
i
)
=
h1
;
val
=
values
(
i
);
j
=
idx
(
val
);
set
(
h
,
...
set
(
[
h1
h2
]
,
...
'Color'
,
colors
(
j
,
:
),
...
'LineWidth'
,
2
)
end
set
(
ax
,
'CLim'
,
[
minv
maxv
]
)
end
src/@deproj/deproj.m
View file @
e6bcc04b
...
...
@@ -17,7 +17,7 @@ classdef deproj
%% Plotting routines.
methods
%% Generate figures.
% Figure with the local plan orientation for a collection of epicells.
...
...
@@ -48,7 +48,7 @@ classdef deproj
hts
=
add_plot_variable
(
obj
,
values
,
ax
)
%Plots the ellipses, colored by the specified values.
hts
=
add_ellipse_variable
(
obj
,
values
,
ax
)
hts
=
add_ellipse_variable
(
obj
,
values
,
cmap
,
ax
)
end
...
...
src/@deproj/plot_fit_ellipse.m
View file @
e6bcc04b
...
...
@@ -9,11 +9,9 @@ function [ hf, he ] = plot_fit_ellipse( obj, scale_bar_length )
hold
on
axis
equal
% TODO set colormap, pass it to colorbar and set caxis limits from
% values. And does this all automatically.
values
=
rad2deg
(
[
obj
.
epicells
.
proj_direction
]
'
);
he
=
add_ellipse_variable
(
obj
,
values
,
gca
);
cmap
=
'hsv'
;
he
=
add_ellipse_variable
(
obj
,
values
,
cmap
,
gca
);
add_plot_scalebar
(
obj
,
scale_bar_length
,
gca
);
axis
(
gca
,
'off'
)
...
...
src/@epicell/fit_ellipse_3d.m
View file @
e6bcc04b
...
...
@@ -38,7 +38,7 @@ function [ f3d, v ] = fit_ellipse_3d( p, E, method )
f
(
1
)
=
f
(
1
)
+
c
(
1
);
f
(
2
)
=
f
(
2
)
+
c
(
2
);
f3d
=
[
f
(
1
:
2
)
c
(
3
)
f
(
3
:
5
)
];
f3d
=
double
(
[
f
(
1
:
2
)
c
(
3
)
f
(
3
:
5
)
]
)
;
end
Write
Preview
Supports
Markdown
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