How to make tracks start from same origin?

I am collecting cell movement tracks from MTrackJ, an ImageJ plugin. I can pass the coordinates of the tracks to an array, but I am trying to make a flowerplot, wherein all my tracks start at the same point and then trace their paths from there. Below is the code I am using so far:
prompt = 'How many tracks do you want to analyze?';
track_num = input(prompt);
disp('Select the track you wish to analyze.')
figure(); hold on for i=1:track_num
filename = uigetfile('*.mdf','C:\Users\Szasz_T\Documents\Matlab'); %Note: file name cannot contain underscores
Track= read_mdf(filename);
Track(:,3:4) = Track(:,3:4)*0.12; %Multiplies by um/pixel; change to whatever ratio you acquire images at
Track(:,6) = Track(:,6)*10; %Multiplies by number of seconds per frame
norm(Track(end,3:4)-Track(1,3:4))/(Track(end,6)-Track(1,6))%Outputs distance traveled in um/s
for i = 1:size(Track,1)-1 %Calculates length of each step in trajectory
Track_steps(i) = norm(Track(i+1,3:4)-Track(i,3:4));
end
zeroes = [0 0 0 0 0 0];
Track = cat(1,zeroes, Track);
plot(Track(:,3), Track(:,4))
end
hold off
title('Representation of Cell Motility')
I can use my "zeroes" array to force the first coordinate to be a certain point, but I do not know how to simply set all tracks to begin at one origin, if this is possible.
Thanks for any help one can offer.

 Respuesta aceptada

Aubrey Howard
Aubrey Howard el 18 de Jul. de 2018

0 votos

I have been struggling with the same issue myself. It's clear you have made much more progress than I have.

1 comentario

Taylor Szasz
Taylor Szasz el 18 de Jul. de 2018
Hi Aubrey,
I ended up actually just doing everything in Excel. I subtracted a set value for the first track from each subsequent track. Hope this helps.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 28 de Sept. de 2015

Comentada:

el 18 de Jul. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by