nd2reader icon indicating copy to clipboard operation
nd2reader copied to clipboard

Bad reader sizes are parsed.

Open joaomamede opened this issue 5 years ago • 1 comments

Hi, nd2reader is having trouble reading a file as it finds "Zs" that are not there.

Image was acquired with triggered imaging 1 Z, 120T, 2044 Y, 2048 X, 24 Visit Points.

pims_nd2readerSDK and pims.bioformats read the file fine. I can share but this file is 20GB. It did this to 2 files from two different experiments. I'll try to crop the data to a small XY, if it replicates I'll share.

%matplotlib inline
import pims
from nd2reader import ND2Reader
from pims import ND2_Reader as nd2_sdk


# fname = 'igfp1_caruby5_continue001trigger003.nd2'
fname = '../Data/igfp1_caruby5_VOG002.nd2'
# fname = 'igfp3_caruby3_rutin_bvd_f2_2days_xy02.nd2'
# fname = '/tmp/test.ome.tiff'

frames =  ND2Reader(fname)
frames_sdk = nd2_sdk(fname)
frames_bioformats = pims.bioformats.BioformatsReader(fname)
# frames.iter_axes = 't'  # 't' is the default already.
# frames.bundle_axes = 'zyx'  # when 'z' is available, this will be default

print(frames.sizes)
print(frames_sdk.sizes)
print(frames_bioformats.sizes)

{'x': 2048, 'y': 2044, 'c': 2, 't': 51, 'z': 1224, 'v': 24} {'x': 2048, 'y': 2044, 'c': 2, 't': 51, 'm': 24} {'x': 2048, 'y': 2044, 'c': 2, 't': 51}

joaomamede avatar Jul 06 '20 18:07 joaomamede

Thank you @joaomamede. Could you please test this again with the latest master version? There was a small error in the parsing code that might affect this issue as well (see #50). Thanks!

rbnvrw avatar Apr 23 '21 10:04 rbnvrw