The reader works well for most nd2 files, however some of my nd2 files are not parsed correctly and I get an error:
EmptyFileError: No axes were found for this .nd2 file.
I think the error occurs during parsing from the end of the file (in _build_label_map):
# go 8 bytes back from file end
self._fh.seek(-8, 2)
chunk_map_start_location = struct.unpack("Q", self._fh.read(8))[0]
where for the files that fail: chunk_map_start_location is assigned to 0.
I suspect that this happens with nd2 files that had an error during acquisition, so the end of the file might be corrupt. However, since nd2 files hold multiple images it means that there are many valuable images in the same file.
The bioimage reader in ImageJ parses and opens those (maybe corrupt) files correctly.
I will be happy to send you an example file, the smallest I have that fails is ~8GB.
The reader works well for most nd2 files, however some of my nd2 files are not parsed correctly and I get an error:
EmptyFileError: No axes were found for this .nd2 file.
I think the error occurs during parsing from the end of the file (in
_build_label_map):where for the files that fail: chunk_map_start_location is assigned to 0.
I suspect that this happens with nd2 files that had an error during acquisition, so the end of the file might be corrupt. However, since nd2 files hold multiple images it means that there are many valuable images in the same file.
The bioimage reader in ImageJ parses and opens those (maybe corrupt) files correctly.
I will be happy to send you an example file, the smallest I have that fails is ~8GB.