figure_distorsions.m 1.18 KB
Newer Older
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
1
function [ hf, ax1, ax2 ] = figure_distorsions( obj, scale_bar_length )
2
3
4
5
6
7
8
9
%PLOT_DISTORSIONS Figure with the error on uncorrected cells area and perimeter.

    if nargin < 2
        scale_bar_length = 10;
    end

    hf = figure( 'Position', [ 1204 20 600 650 ] );
    
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
10
11
    epicells = obj.epicells;
    
12
13
14
    ax1 = subplot( 2, 1, 1 );
    hold on
    axis equal
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
15
16
17
18
19
    areas = vertcat( epicells.area );
    uncorr_areas = vertcat( epicells.uncorrected_area );
    err = 1 - uncorr_areas ./ areas;
    obj.plot_values_contour( 100. * err, ax1 );
    
20
21
22
23
24
    colorbar
    
    ax2 = subplot( 2, 1, 2 );
    hold on
    axis equal
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
25
26
27
28
    perims = vertcat( epicells.perimeter );
    uncorr_perims = vertcat( epicells.uncorrected_perimeter );
    err = 1 - uncorr_perims ./ perims;    
    obj.plot_values_contour( 100. * err, ax2 );
29
30
    colorbar
    
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
31
    obj.add_plot_scalebar( scale_bar_length, ax2 );
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    
    axis( ax1, 'off' )
    axis( ax2, 'off' )
    
    title( ax1, 'Error on cell area (%)', ...
        'FontWeight', 'normal', ...
        'Interpreter', 'none' )
    title( ax2, 'Error on cell perimeter (%)', ...
        'FontWeight', 'normal', ...
        'Interpreter', 'none' )

    linkaxes( [ ax2 ax1 ] )
end