diff --git a/java/pom.xml b/java/pom.xml index a58f9f57..74dc7907 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.micro-manager.pycro-manager PycroManagerJava - 0.46.1 + 0.46.2 jar Pycro-Manager Java The Java components of Pycro-Manager @@ -55,7 +55,7 @@ org.micro-manager.acqengj AcqEngJ - 0.35.1 + 0.36.0 org.micro-manager.ndviewer @@ -112,11 +112,11 @@ - - --pinentry-mode - loopback - - + + --pinentry-mode + loopback + + diff --git a/pycromanager/_version.py b/pycromanager/_version.py index ca045f46..b5a480a9 100644 --- a/pycromanager/_version.py +++ b/pycromanager/_version.py @@ -1,2 +1,2 @@ -version_info = (0, 31, 1) +version_info = (0, 31, 2) __version__ = ".".join(map(str, version_info)) diff --git a/pycromanager/acq_future.py b/pycromanager/acq_future.py index cf570f17..a26fbb35 100644 --- a/pycromanager/acq_future.py +++ b/pycromanager/acq_future.py @@ -31,7 +31,8 @@ def _add_notifications(self, axes_or_axes_list): AcqNotification.Camera.PRE_SNAP: False, AcqNotification.Camera.PRE_SEQUENCE_STARTED: False, - AcqNotification.Camera.POST_EXPOSURE: False, + AcqNotification.Camera.POST_SNAP: False, + AcqNotification.Camera.POST_SEQUENCE_STOPPED: False, AcqNotification.Image.IMAGE_SAVED: False, } diff --git a/pycromanager/acquisition/acq_eng_py/internal/engine.py b/pycromanager/acquisition/acq_eng_py/internal/engine.py index 0b1c7b39..da02f57c 100644 --- a/pycromanager/acquisition/acq_eng_py/internal/engine.py +++ b/pycromanager/acquisition/acq_eng_py/internal/engine.py @@ -246,7 +246,7 @@ def acquire_images(self, event: AcquisitionEvent, hardware_sequences_in_progress height = self.core.get_image_height() self.core.snap_image() event.acquisition_.post_notification(AcqNotification( - AcqNotification.Camera, event.axisPositions_, AcqNotification.Camera.POST_EXPOSURE)) + AcqNotification.Camera, event.axisPositions_, AcqNotification.Camera.POST_SNAP)) for h in event.acquisition_.get_after_exposure_hooks(): h.run(event) @@ -383,6 +383,12 @@ def acquire_images(self, event: AcquisitionEvent, hardware_sequences_in_progress corresponding_event.acquisition_.add_to_image_metadata(ti.tags) corresponding_event.acquisition_.add_to_output(ti) + self.stop_hardware_sequences(hardware_sequences_in_progress) + + if event.get_sequence() is not None: + event.acquisition_.post_notification(AcqNotification( + AcqNotification.Camera, event.axisPositions_, AcqNotification.Camera.POST_SEQUENCE_STOPPED)) + if timeout: raise TimeoutError("Timeout waiting for images to arrive in circular buffer") diff --git a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py index 79ea77a8..e8b77457 100644 --- a/pycromanager/acquisition/acq_eng_py/main/acq_notification.py +++ b/pycromanager/acquisition/acq_eng_py/main/acq_notification.py @@ -20,8 +20,9 @@ def to_string(): class Camera: PRE_SEQUENCE_STARTED = "pre_sequence_started" + POST_SEQUENCE_STOPPED = "post_sequence_stopped" PRE_SNAP = "pre_snap" - POST_EXPOSURE = "post_exposure" + POST_SNAP = "post_snap" @staticmethod def to_string(): @@ -45,8 +46,8 @@ def __init__(self, type, payload, milestone=None): self.type = AcqNotification.Image self.payload = payload self.milestone = milestone - elif milestone in [AcqNotification.Camera.PRE_SNAP, AcqNotification.Camera.POST_EXPOSURE, - AcqNotification.Camera.PRE_SEQUENCE_STARTED]: + elif milestone in [AcqNotification.Camera.PRE_SNAP, AcqNotification.Camera.POST_SNAP, + AcqNotification.Camera.PRE_SEQUENCE_STARTED, AcqNotification.Camera.POST_SEQUENCE_STOPPED]: self.type = AcqNotification.Camera self.payload = json.loads(payload) if isinstance(payload, str) else payload # convert from '{'time': 5}' to {'time': 5} elif milestone in [AcqNotification.Hardware.PRE_HARDWARE, AcqNotification.Hardware.POST_HARDWARE]: diff --git a/pycromanager/test/test_acquisition.py b/pycromanager/test/test_acquisition.py index ced6827c..313300d7 100644 --- a/pycromanager/test/test_acquisition.py +++ b/pycromanager/test/test_acquisition.py @@ -652,3 +652,18 @@ def test_multi_channel_parsing(launch_mm_headless, setup_data_folder): assert all([channel in dataset.get_channel_names() for channel in ["DAPI", "FITC"]]) finally: dataset.close() + + +def test_empty_axes(launch_mm_headless, setup_data_folder): + """ + Test that images with empty axes are correctly saved + """ + + with Acquisition(setup_data_folder, 'acq', show_display=False) as acq: + acq.acquire({'axes': {}}) + + dataset = acq.get_dataset() + try: + assert dataset.read_image() is not None and dataset.read_image().max() > 0 + finally: + dataset.close() \ No newline at end of file