micro-manager/pycro-manager

`AcquisitionFuture.await_image_saved` does not return image and metadata

ilyakolb opened this issue · 1 comments

Using the command:

img,metadata = future.await_image_saved(event['axes'], return_image = True, return_metadata=True)

Expected behavior is that both the image and metadata are returned.

Actual behavior:

    img,metadata = future.await_image_saved(event['axes'], return_image = True, return_metadata=True)
    ^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

Only the image data is being returned because line 152 from the code below never gets called (the function returns on one of the previous if statements).

if return_image:
if isinstance(axes, list):
return [self._acq.get_dataset().read_image(**ax) for ax in axes]
else:
return self._acq.get_dataset().read_image(**axes)
if return_metadata:
if isinstance(axes, list):
return [self._acq.get_dataset().read_metadata(**ax) for ax in axes]
else:
return self._acq.get_dataset().read_metadata(**axes)
if return_image and return_metadata:
if isinstance(axes, list):
return [(self._acq.get_dataset().read_image(**ax), self._acq.get_dataset().read_metadata(**ax)) for ax in axes]
else:
return self._acq.get_dataset().read_image(**axes), self._acq.get_dataset().read_metadata(**axes)

Fixed in #800