Browse Source

Use timesteps as fallback to NDExperiment loops to determine total file duration, and thus framerate

zolfa-add_slices_loading
Ruben Verweij 4 years ago
parent
commit
e309631c84
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      nd2reader/reader.py

+ 4
- 1
nd2reader/reader.py View File

@ -129,7 +129,10 @@ class ND2Reader(FramesSequenceND):
total_duration += loop['duration']
if total_duration == 0:
raise ValueError('Total measurement duration could not be determined from loops')
total_duration = self.timesteps[-1]
if total_duration == 0:
raise ValueError('Total measurement duration could not be determined from loops')
return self.metadata['num_frames'] / (total_duration/1000.0)


Loading…
Cancel
Save