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

Error while parsing some nd2 files #17

Open
bellonet opened this issue Sep 18, 2019 · 5 comments
Open

Error while parsing some nd2 files #17

bellonet opened this issue Sep 18, 2019 · 5 comments

Comments

@bellonet
Copy link

The reader works well for most nd2 files, however some of my nd2 files are not parsed correctly and I get an error:
Exception: LIM_ERR_NOTFOUND

I think that this error occurs when the end of the file is corrupt due to the microscope crashing.
Importantly, I have huge nd2 files holding multiple images so the images that were acquired before the crash are valuable.
Those (maybe corrupt) files can be successfully opened/viewed/resaved as tifs using ImageJ bio-formats plugin.

I will be happy to send you an example file that fails (~8GB).

@tacaswell
Copy link
Member

It looks like those errors are coming out of the vendored .so rather than any code we cantrol....

IIRC (and my personal experience is now ~10 years out of date!), nd2 is a valid tiff file with a bunch of extra metadata shoved into the headers as XML. Have you tried using tifffile to open them?

@rbnvrw
Copy link

rbnvrw commented Sep 29, 2019

Hi @bellonet , @tacaswell I'm the author of the Python package https://github.com/rbnvrw/nd2reader/ which reads ND2 files and also plays nicely with PIMS. In contrast to this package, it is not based on the Nikon SDK but the ND2 is reversed engineered.

The bug is also reported here: Open-Science-Tools/nd2reader#23
In summary, it seems to be caused by the fact that the software crashed before the whole file could be written.
I think it is possible to workaround this, but I don't have the time at this point. If anyone wants to try, please see the issue above.

@bellonet
Copy link
Author

bellonet commented Oct 4, 2019

Thanks @tacaswell . When I try to open a valid nd2 file (meaning, a file that can be opened using ND2_Reader) with tifffile I get the following error:
not a TIFF file

Did it ever work for you in the past? Do you know which parameters I should pass?

@tacaswell
Copy link
Member

As I said, my knowledge is 10+ years out of date... It has been long enough that I may be confusing the output files I had from the nikon software and the output from metamorph....

Sorry if I sent you down a blind alley :/

@forestrywhale
Copy link

I also had the same issue when reading nd2 files. Then I double checked my file, and found that my .nd2 file failed to finish transfer. Thus though the .nd2 is readable by Fiji, it is not for the pims_nd2. The failed file probably have an incomplete ending. The remedy could be using the .nd2 processing tools to crop and re-save the file if the original file is incomplete. For my case, I'll re-transfer my file and it should work.

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

No branches or pull requests

4 participants