Skip to content

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

Description

@TeaWolf

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

Activity

  1. rbnvrw commented on May 1, 2020

    @rbnvrw
    Member

    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.

  2. TeaWolf commented on May 2, 2020

    @TeaWolf
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions