Skip to content

Commit

Permalink
Update the MATLAB example scripts so that they download the files.
Browse files Browse the repository at this point in the history
All automatic!
Thank you Curtis.
  • Loading branch information
tinevez committed May 13, 2024
1 parent f7aad84 commit ab5107c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
13 changes: 11 additions & 2 deletions scripts/ExampleScript_MATLABImportROIs.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@
clear
clc

% Where are the files?
root_folder = '/Users/tinevez/Google Drive/TrackMate/Applications/MATLABimport/';
% Where to store the files?
root_folder = '.';
% TrackMate file.
file_path = fullfile( root_folder, 'MAX_Merged.xml' );
if ~exist( file_path, 'file' )
% Download and uncompress the files.
url = 'https://samples.fiji.sc/tutorials/MATLABtuto.zip';
zip_file_path = fullfile( root_folder, 'MATLABtuto.zip' );
fprintf( 'Downloading tutorial files from %s\n', url )
websave( zip_file_path, url );
fprintf( 'Saved to %s\n', zip_file_path )
unzip( zip_file_path, root_folder )
end

% Read tracks.
[S, idmap, rois] = trackmateSpots( file_path );
Expand Down
15 changes: 13 additions & 2 deletions scripts/ExampleScript_MATLABPlotTracksWithROIs.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,24 @@
clear
clc

% Where are the files?
root_folder = '/Users/tinevez/Google Drive/TrackMate/Applications/MATLABimport/';
% Where to store the files?
root_folder = '.';
% Image file.
movie_path = fullfile( root_folder, 'MAX_Merged-1.tif' );
% TrackMate file.
file_path = fullfile( root_folder, 'MAX_Merged.xml' );

if ~exist( file_path, 'file' ) || ~exist( movie_path, 'file' )
% Download and uncompress the files.
url = 'https://samples.fiji.sc/tutorials/MATLABtuto.zip';
zip_file_path = fullfile( root_folder, 'MATLABtuto.zip' );
fprintf( 'Downloading tutorial files from %s\n', url )
websave( zip_file_path, url );
fprintf( 'Saved to %s\n', zip_file_path )
unzip( zip_file_path, root_folder )
end


%% Read the movie file.

% You can change the image used in this tutorial, but it must be a
Expand Down

0 comments on commit ab5107c

Please sign in to comment.