plot_values_contour.m 766 Bytes
Newer Older
Jean-Yves TINEVEZ's avatar
Jean-Yves TINEVEZ committed
1
2
3
4
5
6
7
8
9
10
function hts = plot_values_contour( obj, values, ax )
%PLOT_VALUES_CONTOUR Plot the tissue with the cell exact contours, colored by the specified values.
%
% INPUTS:
%   obj: a deproj object, with N epicells.
%   values - a N x 1 array with values to use for coloring.
%   ax - the axes to plot in.
% 
% OUTPUT:
%   a N x 1 array of handles to the cell polygon objects.
11
    
12
13
14
    epicells = obj.epicells;
    boundaries = { epicells.boundary };
    n_objects = numel( boundaries );    
15
16
    hts = NaN( n_objects, 1 );
    
17
18
    if n_objects > 1000, lw = 1; else, lw = 2; end
    
19
20
21
22
23
    for i = 1 :  n_objects

        p = boundaries{ i };
        val = values( i );
        hts(i ) = patch( ax, p(:,1), p(:,2), p(:,3), val, ...
24
            'LineWidth', lw );
25
26
    end
end