@ -283,7 +283,13 @@ class Parser(object):
if np . any ( image_data ) :
if np . any ( image_data ) :
return timestamp , Frame ( image_data , metadata = self . _get_frame_metadata ( ) )
return timestamp , Frame ( image_data , metadata = self . _get_frame_metadata ( ) )
raise NoImageError
# If a blank "gap" image is encountered, generate an empty frame (black image) of corresponding height and width to avoid
# errors with ND2-files with missing frames.
else :
empty_frame = np . zeros ( [ height , width ] )
return timestamp , Frame ( empty_frame , metadata = self . _get_frame_metadata ( ) )
# raise NoImageError # <-- delete?
def _get_frame_metadata ( self ) :
def _get_frame_metadata ( self ) :
""" Get the metadata for one frame
""" Get the metadata for one frame