Skip to content
Snippets Groups Projects
Commit 71cce598 authored by Jean-Yves TINEVEZ's avatar Jean-Yves TINEVEZ
Browse files

Example usage of mask_to_cells.

parent 3653b49d
No related branches found
No related tags found
1 merge request!8Mask to objects: Accept B&W contour images as input for cells.
close all
clear
clc
mask_path = 'GT.tif';
% ImageJ mask.
I = imread( mask_path );
tic
[ objects, junction_graph ] = mask_to_objects( I );
fprintf('Analyzed a %d x %d mask in %.1f seconds.\n', size(I,1), size(I,2), toc )
%% Plot everything.
figure
imshow( ~I , [ 0 2 ], 'Border', 'tight' )
hold on
plot( junction_graph, ...
'XData', junction_graph.Nodes.Centroid(:,1), ...
'YData', junction_graph.Nodes.Centroid(:,2), ...
'LineWidth', 2, ...
'EdgeColor', 'b', ...
'EdgeAlpha', 1, ...
'Marker', 'o', ...
'MarkerSize', 4, ...
'NodeColor', 'r' )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment