From 71cce598985023107a2ee54218d30acd8c1a8d7d Mon Sep 17 00:00:00 2001
From: Jean-Yves Tinevez <tinevez@pasteur.fr>
Date: Wed, 4 Dec 2019 14:28:49 +0100
Subject: [PATCH] Example usage of mask_to_cells.

---
 MainScripts/InputSegmentation.m | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100755 MainScripts/InputSegmentation.m

diff --git a/MainScripts/InputSegmentation.m b/MainScripts/InputSegmentation.m
new file mode 100755
index 0000000..6a5e162
--- /dev/null
+++ b/MainScripts/InputSegmentation.m
@@ -0,0 +1,30 @@
+
+
+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' )
-- 
GitLab