Closed wiegraebe closed 3 years ago
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of microscope_automation.
At https://github.com/aics-int/microscope_automation/blob/abecb45022636498489af32098b5ebbfee689661/microscope_automation/samples/interactive_location_picker_pyqtgraph.py#L114 code crashes if self.image.shape has more than two dimensions
In the standard workflow, image should have only two dimensions. The error occurred when image was returned with a third dimension of size 1. A short-term fix could be to squeeze the np array: self.image.squeeze().shape
self.image.squeeze().shape
Be able to handle any number of dimensions.
Run code with preferences file Pipeline5.2.yml
Another example of this occurs in:
https://github.com/aics-int/microscope_automation/blob/abecb45022636498489af32098b5ebbfee689661/microscope_automation/microscope_automation.py#L2110
Short term solution: imsave(image_path, image_data_save.squeeze().T, cmap="gray")
imsave(image_path, image_data_save.squeeze().T, cmap="gray")
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of microscope_automation.
Description
At https://github.com/aics-int/microscope_automation/blob/abecb45022636498489af32098b5ebbfee689661/microscope_automation/samples/interactive_location_picker_pyqtgraph.py#L114 code crashes if self.image.shape has more than two dimensions
In the standard workflow, image should have only two dimensions. The error occurred when image was returned with a third dimension of size 1. A short-term fix could be to squeeze the np array:
self.image.squeeze().shape
Expected Behavior
Be able to handle any number of dimensions.
Reproduction
Run code with preferences file Pipeline5.2.yml