Good afternoon,
I had a question about recording directly to uFMF. With the release of 0.11.1, I am now able to record videos with strand-cam (https://groups.google.com/g/multicams/c/9Cj8ZqNOdzg). But I’m having issues with tracking/playing-back these videos with other tracking software. Are their multiple different versions of uFMF that may be causing compatibility issues?
A little background: with our previous setup we had been recording uncompressed .avi videos with LabView and then converting these uncompressed videos to uFMF using the “any2ufmf” software (http://ctrax.sourceforge.net/any2ufmf.html). These uFMF videos were then tracked with Caltech FlyTracker (http://www.vision.caltech.edu/Tools/FlyTracker/). These videos from any2ufmf are read in and tracked just fine.
But, when we try to open the uFMF videos recorded with strand-cam in Caltech Flytracker it is unable to open the video. Does anyone happen to know what might be the issue? The error message from Caltech FlyTracker’s calibrator.m function is below.
Thanks.
Aaron.
Error message:
Index exceeds the number of array elements (28).
Error in ufmf_read_header (line 79)
header.timestamps < header.mean_timestamps(i+1);
Error in video_open (line 55)
vinfo.ufmf = ufmf_read_header(filename);
Error in calibrator (line 24)
vinfo = video_open(f_vid,1);
Error in tracker>tracker_interface/runCalibrator (line 646)
calib_success = calibrator(f_vid,f_calib);
Error while evaluating UIControl Callback.
--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multicams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/multicams/5123edfb-a4fd-4242-8b91-6333dda5abbdn%40googlegroups.com.
Dear Andrew,
Thanks for the rapid response.
I agree that adding support for CTrax style uFMF to Strand Camera may not be the best (for the reasons you cite), and that it would be better to add support for Strand Camera uFMF videos to FlyTracker.
Not sure how much use posting on the CTrax google group would be, as they don’t maintain the code for FlyTracker (which has its own google group - https://groups.google.com/g/flytracker). That being said, neither group seems to have any activity from either the original developers or anyone who may be maintaining the software...
It does seem that Kristin Branson might have officially/unofficially taken over some maintenance of FlyTracker (https://github.com/kristinbranson/FlyTracker). Or at the very least is making some changes/updates available for what they are using internally. Perhaps I will ask there, to see if they are willing to add compatibility for Strand Camera uFMF videos.
Do you have any documentation on the Strand Camera uFMF definition/description? I’ve attached a copy of the latest version (I think … it doesn’t appear as if it has changed for over a decade ...) of the CTrax-uFMF description, and the source code for any2ufmf software is available here https://github.com/kristinbranson/any2ufmf (again, I think … not clear if this is the most recent version). Using the `ufmf_read_header.m` MATLAB function from FlyTracker (https://github.com/kristinbranson/FlyTracker/blob/main/tracking/utilities/ufmfread/ufmf_read_header.m) to read the header of a CTrax-uFMF, and the `read.ufmf.header.R` function from Greg Jefferis’ fmfio package in R (https://github.com/jefferis/fmfio/blob/master/R/read.ufmf.R) to read the header of a Strand Camera uFMF, I noticed that they seem to differ in the `mean_timestamps`. For the CTrax uFMF videos `nmeans` appears to be equal to the length of `mean_timestamps`, however in the Strand Camera uFMF videos `nmeans` appears to be 2x the length of `mean_timestamps`. This seems to be what’s causing the issue (or at least first issue) when trying to read Strand Camera uFMF with the CTrax style readers, based on the error messages previously shown. The also differ in how the dimensions of the video are specified with CTrax style having 2 separate fields for `max_height` and `max_width` and Strand Camera style having a paired value for the field `max_imdims`.
I'm curious (in super broad strokes) how Strand Camera goes about making the uFMF video. Is it “keeping” the lossless information from all regions that are different enough from the mean/median background? Or is it only focusing on coordinates of the tracked individual? Since you need the real time tracking turned on and it appears to be setup to only track one individual, I’m wondering if the Strand Camera generated uFMF videos appropriate for recording multiple individuals at a time? I’ve included a sample image of our arenas that we currently record below, which typically have 20-60 flies.
On another related note, what would you say is the best way to playback and view the uFMF videos generated by Strand Camera?
Thanks again for all your assistance.
Aaron.