Last active
December 21, 2015 21:08
-
-
Save sbesson/6365887 to your computer and use it in GitHub Desktop.
Example of usage of u-track with a microscopy file using Bio-Formats and an image onto an OMERO server
This file contains 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
% Create MovieData object from image file stored on disk | |
MD = MovieData.load(fullfile(path, 'myimage.dv')); | |
% Manipulate the movie, e.g. retrieve the first image of the first channel | |
I = MD.getChannel(1).loadImage(1); | |
% Remove all analysis performed on the movie | |
MD.reset(); | |
% Set up single-particle tracking package | |
MD.addPackage(UTrackPackage(MD)); | |
% Set up default single-particle detector and run detection step | |
MD.getPackage(1).createDefaultProcess(1); | |
MD.getPackage(1).getProcess(1).run(); | |
% Set up default tracking and run tracking step | |
MD.getPackage(1).createDefaultProcess(2); | |
MD.getPackage(1).getProcess(2).run(); | |
% Set up default tracking post-processing and run post-processing step | |
MD.getPackage(1).createDefaultProcess(3); | |
MD.getPackage(1).getProcess(3).run(); | |
% Reload movie from MAT file stored on disk | |
MD = MovieData.load(fullfile(path, 'myimage', 'myimage.mat')); | |
% Re-run the detection step | |
MD.getPackage(1).getProcess(1).run(); | |
% Load the detection output for the the first channel | |
movieInfo = MD.getPackage(1).getProcess(1).loadChannelOutput(1); | |
% Draw the first frame and the | |
figure; | |
MD.getChannel(1).draw(1); % draw the first image of the first channel | |
MD.getPackage(1).getProcess(1).draw(1, 1); % draw the output of the first frame/first channel for the detection process |
This file contains 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
try | |
% Create client and session | |
[c, s] = loadOmero(); | |
% Read image id from config file | |
imageID = str2double(c.getProperty('omero.imageid')); | |
% Create MovieData object from remote OMERO image | |
MD = MovieData.load(s, imageID); | |
% Remove all analysis performed on the movie | |
MD.reset(); | |
% Set up single-particle tracking package | |
MD.addPackage(UTrackPackage(MD)); | |
% Set up default single-particle detector and run detection step | |
MD.getPackage(1).createDefaultProcess(1); | |
MD.getPackage(1).getProcess(1).run(); | |
% Set up default tracking and run tracking step | |
MD.getPackage(1).createDefaultProcess(2); | |
MD.getPackage(1).getProcess(2).run(); | |
% Set up default tracking post-processing and run post-processing step | |
MD.getPackage(1).createDefaultProcess(3); | |
MD.getPackage(1).getProcess(3).run(); | |
% Reload movie | |
MD = MovieData.load(s, imageID); | |
% Re-run the detection step | |
MD.getPackage(1).getProcess(1).run(); | |
catch err | |
disp(err.message) | |
c.closeSession(); | |
exit(2) | |
end | |
c.closeSession(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment