diff --git a/src/@deproj/deproj.m b/src/@deproj/deproj.m index 5207220026e0f564df63a959aa78fa7e09298fb5..87e451edc6be41d410b7626269e9cef090d313fa 100644 --- a/src/@deproj/deproj.m +++ b/src/@deproj/deproj.m @@ -28,8 +28,8 @@ classdef deproj %% Conversion between MATLAB objects. - % Returns the faces and vertices of a deproj collection. - [ V, F ] = to_vertices_and_faces( obj ) + % Returns the faces and vertices of the junction graph of a instance. + [ V, F ] = graph_to_VF( obj ) % Returns the cells boundary polygons as 3 matrices padded by NaNs. [ X, Y, Z ] = to_matrices( obj ) @@ -65,6 +65,10 @@ classdef deproj % Plot the tissue with cells as ellipses, colored by the specified values. hts = plot_values_ellipse( obj, values, ax ) + + % Plot the tissue with the cell contour approximated by the junctions, colored by the specified values. + hts = plot_values_junction( obj, values, ax ) + end diff --git a/src/@deproj/plot_values_junction.m b/src/@deproj/plot_values_junction.m new file mode 100644 index 0000000000000000000000000000000000000000..1423d836ce0e445e503d086b4f9ceee216016878 --- /dev/null +++ b/src/@deproj/plot_values_junction.m @@ -0,0 +1,18 @@ +function hts = plot_values_junction( obj, values, ax ) +%PLOT_VALUES_JUNCTION Plot the tissue with the cell contour approximated by the junctions, colored by the specified values. + + [ V, F ] = obj.graph_to_VF(); + + n_objects = numel( obj.epicells ); + if n_objects > 1000, lw = 1; else, lw = 2; end + + hts = patch( ... + 'Faces', F, ... + 'Vertices', V, ... + 'FaceVertexCData', values, ... + 'FaceColor', 'flat', ... + 'LineWidth', lw, ... + 'Parent', ax ); + +end +