ND2 video frame time stamp corruption in ImageJ metadata

I’m writing ImageJ macros for muscle cell contraction analysis and as part of that I need to determine the frame rate of videos which I record using Nikon NIS software in ND2 format. In that software the frame rate is not recorded in the metadata but the timestamp of every frame is and so I’m trying to use the timestamp data as a workaround to get frame rate. Unfortunately when the video is opened in ImageJ using BioFormats the Show Info function corrupts the timestamp data;

Nikon Metadata Time [s.ms] Index X Coord [µm] Y Coord [µm] Z Coord [µm] Frame Index ImageJ Metadata
0 1 -6903.4 -74.6 1426.08 1 timestamp #0001 = 2.390218930888084E-302
0.0025 2 -6903.4 -74.6 1426.08 2 timestamp #0002 = 1.120248862000071E-303

I’ve searched this forum and found a previous answer to getting this data but it dated from 2018 and suspect Nikon have altered their metadata format since.

This video was recorded at 400fps (1/0.0025) but I can’t see any pattern in the ImageJ version. The ‘E-3’ element make sense but none of the other digits match anything in the Nikon table.

Any suggestions for getting frame rate or fixing this issue are appreciated.

Scott K.

1 Like

Hi @scottk, thanks for raising the issue. We also received another repot on ND2 timestamps today (https://github.com/ome/bioformats/issues/3565), is this something that has only recently occurred? Do you know if you have made any updates to your NIS software recently that may have changed the format?

Also if you have a sample file with expected values that you can share that would be of great help. You can upload a sample to https://www.openmicroscopy.org/qa2/qa/upload/

Dear @dgault,
I mentioned the issue on GitHub. Unfortunately, I do not know if the issue is new or not as we just started to regularly do time-lapses now.
The version of the NIS-elements we are using is 5.21.01 b1483 which is a rather recent version.

Thanks for looking into it,

Antonio

Thanks Antonio, I will try and investigate further using the sample file you provided and aim to track the bug using the GitHub Issue you opened.

hi dgault,
i’ve only been looking recently so i can’t say but given i found forum comments from 2018 indicating ImageJ correctly interpreted the ND2 metadata regarding timestamp values, then it would appear to be since then.
we’ve not upgraded NIS and are using Ver 5.11.02 Build 1369, 64bit.

happy to upload data, but which specifically do you want. the nd2 files are about 13GB which i presume are too big. in my original post i loaded the data as exported by NIS to excel and ImageJ’s version for the first two frames. I could upload more of these or would you prefer something else?

cheers,

scott K.

Ahuh…i’ve found a work around. Well not really a work around but a metadata parameter called “dAvgPeriodDiff” which is the average time difference between when frames were captured in milliseconds, or the inverse of frame rate. Weirdly several lines later in the metadata is the maximum and minimum PeriodDiff values, why these aren’t immediately after I don’t know. Anywho, this gives me the data I need.

Mind you the date of capture is also incorrectly interpreted by Bioformats as the last digit in the dd/mm/yyyy is missing and a 9 is added to start so the format is 9dd/mm/yyy. Which for nd2 videos recorded in 2019 is an easy fix, but for 2020 and any other not ending in 9 is impossible to correct.

Suggestion welcome.

Thanks for the update Scott, glad you at least have a workaround for now. I have never seen the date issue reported before, I will investigate and open a GitHub Issue for it if I am able to reproduce the same error.

Hi David,

I’m happy with work around as it’s simple to implement but it would be nice to see these misinterpretations fixed.

A colleague here sent me her ND2 files from last year that were acquired at much lower frame rates (~3Hz), and the time stamp data is correct after BioFormat processing. Her time stamp data is expressed differently as floats eg., 0.3688 while mine is as posted.

Also her date and time of day values are as in my post, which is a greater worry as the correct year cannot be determined.

When I get back to work Monday I can send the full details of our software versions and process used, will that help?

Cheers,

Scott K.

Disclaimer

This email (including any attachments) is intended only for the addressee. It may contain confidential information. Confidentiality is not waived or lost if you are not the intended recipient of this email, nor may you use, review, disclose, disseminate or copy any information contained in or attached to it. If you received this email in error, please delete it and any attachments from your system and notify us immediately. It is your responsibility to check this email and any attachments, before opening or using them, for viruses or defects. You assume all liability arising from opening or using this email and any attachment.

Thanks Scott, any further information on software versions etc are always going to be useful for cases such the differing timestamps.

Hi David,

I thought I’d sent the version of NIS we are using but I did forget the ImageJ version which is 1.52p and I’ve updated it recently using the auto-update function. Does this mean the BioFormats plugin is up to date?

Cheers,

Scott K.

image001.jpg

PS: in case I didn’t

Software: NIS-Elements AR

Ver: 5.11.02 (Build 1369)

image001.jpg

Thanks for the details Scott and apologies for the delayed response, we have been busy with our users meeting this week.

As long as the the Java-8 update site is selected (under Manage Update Sites in the updater window) then using the auto-update will keep you up to date with the latest Bio-Formats. You can also confirm the version using Help > About Plugins > Bio-Formats Plugins. The latest release will be 6.5.0

Hi David,

No worries and thanks for getting back to me.

I checked out my version of BioFormats as you suggested and found it was all in order with version 6.5.0. I also checked using the Advanced Mode in the ImageJ Updater and noticed that the Metakit-5.3.2.jar was released back in September 2018 and therefore possibly out of date, but is it used to read the metadata in nd2 files?

Cheers,

Scott K.

image001.jpg

Hi Scott

David is currently off.
The version of metakit (5.3.2) is the latest that we released so everything is in order also on that front.
This library is not used to read the nd2 files.

Cheers

Jmarie

Hi Jmarie,

Ok. Thanks very much. Do you know which element does handle interpretation of nd2 files?

Cheers,

Scott K.

Hi Scott

https://github.com/ome/bioformats/blob/78ca5dfe337c1ff6335d422d2094fa5a32016407/components/formats-gpl/src/loci/formats/in/NativeND2Reader.java is the reader
so we will need to investigate what is happening with the version of the file.

Cheers

Jmarie

Hi Jmarie,

Thanks. It would be good to get this sorted.

I could look back through my 2018-9 archive and see what errors appear on slow and fast FPS files. This should determine if it’s a version issue as opposed to a frame rate issue, or do you know this?

Cheers,

Scott K.

Hi Scott

I don’t know the answer.
If you manage to collect some info that will be very useful

Cheers

Jmarie

Hello @j.burel, @scottk, and @dgault,

is there any news on this issue if this has been solved?
The nd2 files time stamp can’t still be read in ImageJ via Bioformats.

Thanks

Antonio

Hi Antonio,

Sorry for not following this up but I’ve put it in the too hard basket and got on with the work knowing this error exists.

I did check and saw the date is correct in the NIS software but when Nd2 images are opened using bioformats the date does not display correctly when Show Info is selected. Also the macro function when configured to read the date does not return it correctly. In both cases it appears the last character of the date text string is being lost.

I’ll send Jmarie some info and see what comes.

Cheers,

Scott K.