% skipt na určenie trajektorie pohybu buniek
clear all;close all;clc

f = imread('T0-B_O.tif'); 
f(:,:,4) = [];
figure('Name','Movement','NumberTitle','off');
set(gcf, 'Position', get(0, 'Screensize'));
imshow(f);
hold on;
% prva bunka - suradnice pohybu od T0-T4
x = [223.57 226.03 226.88 227.89 228.38];
y = [592.35 565.29 540.12 519.30 501.26];
delka = length(x);
Sign = ('K1')
text(x(1)+35,y(1)+35,Sign,'VerticalAlignment','bottom','HorizontalAlignment','right','Color','white')
plot(x, y, 'rx', 'MarkerSize', 10, 'LineWidth', 1);

axis([0 800 0 1100]);
hold on;

for i = 1:(delka-1)
   line([x(i),x(i+1)], [y(i),y(i+1)], 'Color', 'r','LineStyle',':','LineWidth', 1);
end
% druha bunka
x1 = [454.87 482.74 520.87  572.48 640.55];
y1 = [384.53  311.78 232.63 148.24 56.88];
labels = {'T0','T1','T2','T3','T4'};
delka1 = length(x1);
Sign = ('K2')
text(x1(1)+35,y1(1)+35,Sign,'VerticalAlignment','bottom','HorizontalAlignment','right','Color','white')
plot(x1, y1, 'y+', 'MarkerSize', 10, 'LineWidth', 1);
text(x1,y1,labels,'VerticalAlignment','bottom','HorizontalAlignment','right','Color','green')
axis([0 800 0 1100]);
hold on;

for i = 1:(delka1-1)
   line([x1(i),x1(i+1)], [y1(i),y1(i+1)], 'Color', 'y','LineStyle',':','LineWidth', 1);
end
%tretia bunka
x2 = [586.48 624.38  672.83 735.36];
y2 = [249.38 177.03 98.41 16.81];
delka2 = length(x2);
Sign = ('K3')
text(x2(1)+35,y2(1)+35,Sign,'VerticalAlignment','bottom','HorizontalAlignment','right','Color','white')
plot(x2, y2, 'm+', 'MarkerSize', 10, 'LineWidth', 1);
axis([0 800 0 1100]);
hold on;

for i = 1:(delka2-1)
   line([x2(i),x2(i+1)], [y2(i),y2(i+1)], 'Color', 'm','LineStyle',':','LineWidth', 1);
   
end
hold off;
a = imread('T0-B_O.tif');
a(:,:,4) = [];
b = imread('T3-C_O.tif');
b(:,:,4) = [];
% Zobrazenie pohybu
figure('Name','Trajectory','NumberTitle','off');
set(gcf, 'Position', get(0, 'Screensize'));
subplot(231);
imshow(a);
title('Čas T0');
subplot(232);
imshow('T1-C_O.tif');
title('Čas T1');
subplot(233);
imshow('T2-C_O.tif');
title('Čas T2');
subplot(234);
imshow(b);
title('Čas T3');
subplot(235);
imshow('T4-C_O.tif');
title('Čas T4');



