tlambert03 / nd2

Full-featured nd2 (Nikon NIS Elements) file reader for python. Outputs to numpy, dask, and xarray. Exhaustive metadata extraction
https://tlambert03.github.io/nd2
BSD 3-Clause "New" or "Revised" License
54 stars 15 forks source link

Fix frame offsets when validate_frames != True, add `validate_frames` param to `imread` #54

Closed tlambert03 closed 2 years ago

tlambert03 commented 2 years ago

This will fix the remaining issues that @KaSaBe had after #51, mentioned in https://github.com/tlambert03/nd2/issues/50#issuecomment-1131386460

This was actually a latent bug that wasn't being tested. (@KaSaBe, your files are just fine and didn't need the validate_frames argument at all, there was just an offset error being hidden otherwise).

Test added, so shouldn't happen again

edit: The vast majority of this PR is actually mostly just docs, and adding the validate_frames argument to nd2.imread, the real fix is this line: https://github.com/tlambert03/nd2/pull/54/files#diff-0838554df4a5ec6bdc4f03e3a3d48befd1da843bc8a3edc88e361ea90671ddaeR168