diff --git a/scripts/ExampleScript_MATLABImportROIs.m b/scripts/ExampleScript_MATLABImportROIs.m index 3539b78dc..0e31cf3f0 100644 --- a/scripts/ExampleScript_MATLABImportROIs.m +++ b/scripts/ExampleScript_MATLABImportROIs.m @@ -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 ); diff --git a/scripts/ExampleScript_MATLABPlotTracksWithROIs.m b/scripts/ExampleScript_MATLABPlotTracksWithROIs.m index 17afd5dec..34ab8f635 100644 --- a/scripts/ExampleScript_MATLABPlotTracksWithROIs.m +++ b/scripts/ExampleScript_MATLABPlotTracksWithROIs.m @@ -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