I have run in to another problem today. I have updated the Fiji with Java 8 enabling the use of latest TrackMate 3.4. Fiji is working fine so as TrackMate. But, inside Matlab script, the initializing the ‘model’ for trackmate is giving error that was working fine previously with TrackMate 2.8. Do I need to update the ‘mij.jar’ file in the Matlab too?
model = fiji.plugin.trackmate.Model();
Undefined variable “fiji” or class “fiji.plugin.trackmate.Model”.
Error in TrackMate_MatlabScript (line 19)
model = fiji.plugin.trackmate.Model();
a lot of of these
log4j:WARN No appenders could be found for logger (loci.formats.ClassList).
log4j:WARN Please initialize the log4j system properly.
How do I take care of the errors? And, log4j warning?
@tinevez@imagejan following is what I am doing and the last line is not working. I am running trackmate inside Matlab and have successfully created tracks on images. I want to use save these tracks for record and further analyse them with your ‘@msdanalyser’ and vbSPT in Matlab.
ImagePlus (reader) cannot correctly the dimension order (ie ‘XYZCT’) saved by the Bioformat (OME) metadata. In my case, it is reading the ‘T’ as ‘Z’ and the tracking is obstructed. As soon as I save the same movie file using FIJI’s save command (instead of ‘bfsave’ in Matlab) the TrackMate is working properly. I am trying finding a remedy for that.
Thank you again for your time and help. I really appreciate it.
Are you sure that you are reading in OME format actually?
From this file name, I’d suppose that ImageJ reads the file as plain tif. What happens if you rename the file to .ome.tif instead of .ome-2.tif, or if you explicitly use Bio-Formats to import the image?
@imagejan That was a good point. I have saved the movie again as “Halo-CALM_Cell8-2.ome.tif” and got the same error as follows
Error using TrackMate_MatlabScript (line 147)
Java exception occurred:
java.lang.IllegalArgumentException: Argument out of range: 1
originated from the following code
ok = trackmate.process();
This problem is occurring when I read the movie file by calling ImagePlus inside the Matlab as well as when I open the movie using FIJI’s standard ‘open’ command. During the erroneous image reading in FIJI, TrackMate corrects the order by asking whether the order has been switched between ‘Time’ and ‘Plane’. But interestingly this problem goes away when I open the same movie file thru BioFormat. In that case, the order is read correctly and no further warning is given by TrackMate function. That is why I think the ImagePlus function in not correctly reading the .ome.tif file. I have also noticed someone else complained about a similar problem couple of years ago (not 100% sure though). http://forum.image.sc/t/bioformats-export-as-ome-tiff-scale-bug/2625 https://github.com/scifio/scifio-ome-xml/issues/8.
Whereas, the same movie file when opened using BioFormat and then saved using FIJI’s ‘save’ function, can then be used to track particles using TrackMate.
Let me know if it make sense or I am doing something wrong in the following image reading. Image properties switched between ‘T’ and ‘Z’.
Thanks for looking in to it. It has already been quite bit of help.
I am encountering similar problem when files (time-series movie) that are saved using Bio-Format’s bfsave as .ome.tif can’t be read accurately using ImagePlus function. The dimension order is switched between ‘Time’ and ‘Z-stack’. I think the ImagePlus function in not correctly reading the .ome.tif file format and metadata. I can reproduce the same problem even when I save .ome.tif file using Fiji’s 'saveas' followed by opening the file using FIJI’s standard 'open' function.
I highly appreciate any help on this matter.
PS. I am following up on this topic after a long time because I was unable to post in this forum ‘502 bad gateway’ error
ok, I’ve also sometimes used programmatically trackmate to do just detection; not in matlab but in jython.
I’ve noticed that if you export using a model with only the detection part without the tracking the XML is someway not fine.
my solution is to just put a fake tracker adding it to the model, even if you don’t need it.
then my XML were good.
at the moment I am writing you using a smartphone… so I cannot easily put you down a snippet.
just add a tracker and try to recover the nspots in matlab.
I tried a stack that I generated that is just one spot, 10pixels in diameter, moving 10px/frame, using the first template from https://imagej.net/Using_TrackMate_from_MATLAB, changing just the radius to 5px, and the threshold to 10, and then added the lines
Sure, I’m just trying now with the default script from the ImageJ Trackmate site, just to get it working:
% Send all messages to ImageJ log window.
% Prepare settings object
%settings = Settings();
settings = fiji.plugin.trackmate.Settings();
% Configure detector - We use a java map
settings.detectorFactory = LogDetectorFactory();
map = HashMap();
map.put('RADIUS', radius); %added variable
map.put('THRESHOLD', threshold); %added variable
settings.detectorSettings = map;
% Configure tracker - We want to allow splits and fusions
settings.trackerFactory = fiji.plugin.trackmate.tracking.sparselap.SparseLAPTrackerFactory();
settings.trackerSettings = LAPUtils.getDefaultLAPSettingsMap(); % almost good enough
% Configure spot filters - Classical filter on quality
%filter1 = FeatureFilter('QUALITY', 1.0, true);
% Configure track analyzers - Later on we want to filter out tracks
% based on their displacement, so we need to state that we want
% track displacement to be calculated. By default, out of the GUI,
% not features are calculated.
% The displacement feature is provided by the TrackDurationAnalyzer.
% Instantiate plugin
trackmate = TrackMate(model, settings);
The test image is just a set of 50 frames with a spot of 10px diameter moving 45 degrees at 10px/frrame