Open-Science-Tools / nd2reader

Pure Python library for reading NIS Elements ND2 images and metadata
http://www.lighthacking.nl/nd2reader
GNU General Public License v3.0
46 stars 29 forks source link

default_coords fails for t (always stuck at time 0) #37

Closed joaomamede closed 4 years ago

joaomamede commented 4 years ago

default_coords['t'] does not change when assigned.

c and v work fine.

frames =  ND2Reader(fname)
# fames2 = nd2_two(fname)
# frames = pims.bioformats.BioformatsReader(fname)
# frames.reader=0
# frames.iter_axes = 't'  # 't' is the default already
frames.bundle_axes = 'zyx'  # when 'z' is available, this will be default
frames

print(frames.sizes['v'])
print(frames.sizes['t'])

frames.default_coords['t'] = 0
frames.default_coords['v'] = 2
print(frames[0].mean())

frames.default_coords['c'] = 0
frames.default_coords['t'] = 20
frames.default_coords['v'] = 0
print(frames[0].mean())

frames.default_coords['c'] = 1
frames.default_coords['t'] = 0
print(frames[0].mean())

frames.default_coords['c'] = 0
frames.default_coords['t'] = 50
print(frames[0].mean())

frames.default_coords['c'] = 1
frames.default_coords['t'] = 50
print(frames[0].mean())

> 10
> 120
> 160.967576548358
> 165.96041711258562
> 124.08112726080907
> 165.96041711258562
> 124.08112726080907
> 
joaomamede commented 4 years ago

I had frames.iter_axes = 't' Sorry.