Aharoni-Lab / Miniscope-DAQ-QT-Software

Software for streaming and controlling neural and behavioral data from freely behaving animals
GNU General Public License v3.0
116 stars 29 forks source link

V3 saving issue/ windowScale #41

Closed Mraymon5 closed 3 years ago

Mraymon5 commented 3 years ago

We're attempting to transition to using the new software, and we're having a possible compatibility problem with our V3 scopes, specifically regarding saving videos and the windowScale variable in config.

If we attempt to set windowScale to 1 (on our assumption that we want the scale of our window to be 1/1), the scope will connect normally and the live video feed displays perfectly, but any recordings we attempt to save are empty (0kb), or if we use Set Frame to crop the recording area, it will save a video, but with the frame apparently wrapped incorrectly, such that the output is diagonal stripe-y nonsense.

If we set windowScale to 0.75, everything works essentially normally. Based on the comments in the Config, this shouldn't effect the scale of the saved video, which would make this an acceptable solution, but it is kind of perplexing nevertheless.

For what it's worth, we attempted to troubleshoot this with our V4 scope also, and setting windowscale to 1 doesn't seem to cause any problems.

Ultimately, our intent here is to get confirmation that using windowScale = 0.75 on our V3 scopes is a workable solution, and isn't going to inadvertently crop or downsample our recording area?

daharoni commented 3 years ago

Hi, This is an interesting issue. Yes the windowScale entry in the user configuration should pretty much only affect how the video stream is displayed to screen. The one exception here is if you draw an ROI on the window to trim the field-of-view to be saved, the windowScale variable becomes involved in converting on screen pixel edges of the drawn ROI to raw image stream pixel locations.

We generally don't test things in too much detail with the V3 but I think we have done quite a bit of testing with this feature with the V4 and never run into issues.

I am glad you have a temporary way to avoid issues currently. When I have time I will look into this and try to track down the issue.

To convince yourself that the windowScale at 0.75 isn't downsampling or improperly scaling the saved data do the following:

Let me know if you have any other issues/questions for now.

Mraymon5 commented 3 years ago

Thanks for the prompt reply! We'll try that out and let you know what we find, for posterity.

Mraymon5 commented 3 years ago

We have an update; it seems like effect we were seeing from the windowScale variable was at least somewhat coincidental. It seems like the real crux of the issue was the ROI selection. Setting the ROI to 752 x 480 in the config seems like the solution, as you indicated; files recorded stably regardless of the value of windowScale, and the saved files were the correct proportions (752 x 480).

Out of interest we tried supplying different ROI values, and THAT reintroduced the problems we were seeing before. For instance, setting the ROI to 50 x 100 recreated the weird image wrapping problem, and that seemed to be true regardless of the value of windowScale.