Last active
June 24, 2022 15:31
-
-
Save ajay1685/a9e7941f554c7f9cf0ca8632619ab066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%From TrackMate export the tracks as xml | |
xmlfile = 'Full path to the \Tracks.xml'; | |
close all; | |
tracks = importTrackMateTracks(xmlfile); | |
%set track origin to zero cordinates | |
zeroTrackX = zeros(size(tracks{1,1}(:,2),1),size(tracks,1)); | |
zeroTrackY = zeros(size(tracks{1,1}(:,2),1),size(tracks,1)); | |
for i=1:1:size(tracks,1) | |
zeroTrackX(:,i) = (tracks{i,1}(:,2) - (tracks{i,1}(1,2))); | |
zeroTrackY(:,i) = tracks{i,1}(:,3) - (tracks{i,1}(1,3)); | |
end | |
figure('ToolBar','none','InvertHardcopy','off','Color',[1 1 1],'Renderer', 'painters', 'Position', [10 10 600 500]); | |
plot(zeroTrackX,zeroTrackY,'LineWidth',1.5,'Color',[0 0 1]) | |
ax = gca; | |
ax.XAxisLocation = 'origin'; | |
ax.YAxisLocation = 'origin'; | |
ax.Position = [0 0 1 1]; | |
maxAxis = ceil((max(max((max(abs(zeroTrackX(:,:))))),max((max(abs(zeroTrackY(:,:)))))))); | |
axis([maxAxis*-1,maxAxis,maxAxis*-1,maxAxis]) | |
box(ax,'off'); | |
set(ax,'FontName','helvetica','FontSize',12,'FontWeight','normal','LineWidth',1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment