Commit 18734fcf authored by Jean-Yves TINEVEZ's avatar Jean-Yves TINEVEZ
Browse files

When plotting the fit of ellipses, also plot direction of elongation.

parent 6b2f62ce
......@@ -17,10 +17,40 @@ function [ hf, hc, he ] = plot_fit_ellipse( obj, scale_bar_length )
for i = 1 : n_obj
o = epicells( i );
[ f3d, v ] = fit_ellipse_3d( double( o.boundary ) );
v = epicell.euleurZXZ2rot( o.euler_angles );
hc( i ) = o.plot_contour_3d;
he( i ) = plot_ellipse_3d( f3d, v );
% hc( i ) = o.plot_contour_3d;
he( i ) = epicell.plot_ellipse_3d( o.ellipse_fit, v );
% Ellipse semi-major axis arrow.
x0 = o.ellipse_fit( 1 );
y0 = o.ellipse_fit( 2 );
z0 = o.ellipse_fit( 3 );
a = o.ellipse_fit( 4 );
theta = o.ellipse_fit( 6 );
% In ellipse referential.
arrow_x = [ -a; a ];
arrow_y = [ 0; 0 ];
Ar0 = [ arrow_x, arrow_y ];
% In epicell plane referential.
R = [ cos( theta ) sin( theta ) ;
-sin( theta ) cos( theta ) ] ;
Ar1 = Ar0 * R;
arrow_z = [ 0; 0 ];
Ar1b = [ Ar1 arrow_z ];
% In main referential.
Ar2 = Ar1b * v';
line( ...
Ar2(:,1) + x0,...
Ar2(:,2) + y0, ...
Ar2(:,3) + z0, ...
'Marker', '.', ...
'Color', 'k' )
end
set( he, 'Color', 'k' )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment