Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ND2Reader gets incorrect video length for cut movies with NISElements #29

Open
TeaWolf opened this issue Nov 1, 2019 · 2 comments
Open

Comments

@TeaWolf
Copy link

TeaWolf commented Nov 1, 2019

We're dealing with some large movies that were cut into several parts to be treated on other computers, original movie is of dimensions (c, t, x, y, z) = (2, 1715, 512, 512, 35) and was cut into segments of approximately (2, 300, 512, 512, 35) with NISElements.

The issue is that in the nd2 metadata the Dimensions section still shows T(1715) x Z(35).
Therefore your code says that there are more frames in the video than there actually are.

By exporting the metadata in Fiji (which gets the correct video length) I can see that there's a property called sizeT which has the correct length.

I was trying to get to this value from image_text_info in the RawMetadata but to no avail. Is there any way for me to retrieve this data.

Here's the metadta from FIJI
metadata.log

@rbnvrw
Copy link
Member

rbnvrw commented May 1, 2020

Thank you for the report @TeaWolf

I'm not sure where Fiji gets that number from, maybe it is just a count of the frames that can be found in the file, instead of parsing it from the metadata that is saved in the ND2 file (which is apparently not updated when cutting the length in NISElements).

Currently, we rely on the metadata to do everything, because it is much faster than first loading (or skimming) all the data. However, from issues #23 and maybe even #31, it becomes clear that this metadata based approach might not be sufficient.

Therefore, it would maybe be beneficial to use the actual data that can be found in the file and keep the stored metadata as a reference. I'll try to look into this, but it might take some time, as I have to reverse-engineer some of the parts of the ND2 format.

@TeaWolf
Copy link
Author

TeaWolf commented May 2, 2020

Well in the mean time I had gotten around the issue simply by looping over the video until error, then setting this as the new length.
Didn't impact performance much in my application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants