Skip to content

Conversation

@jeskesen
Copy link
Collaborator

Addresses: #179 (partial) & #184

jeskesen and others added 25 commits May 19, 2025 11:34
…ccess Oryx camera using mmc.getCameraDevice() instead of hard-coded string
@jeskesen jeskesen requested a review from ieivanov July 15, 2025 17:01
@jeskesen
Copy link
Collaborator Author

jeskesen commented Jul 15, 2025

Note: The author is wrong for some of these commits because the default user for the labelfree user on Mantis is Author: ieivanov <[email protected]>. I hadn't noticed when I first started committing on that system. I subsequently fixed it for that specific working copy.

@jeskesen
Copy link
Collaborator Author

jeskesen commented Jul 15, 2025

I am unable to reproduce the pytest failure:

=============================================================================================================== 9 passed in 1.09s ===============================================================================================================
(pymmcoreplus) PS C:\Users\labelfree\shrimPy> pytest -vvv
============================================================================================================== test session starts ==============================================================================================================
platform win32 -- Python 3.10.16, pytest-7.4.4, pluggy-1.6.0 -- C:\Users\labelfree\.conda\envs\pymmcoreplus\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\labelfree\shrimPy
configfile: pyproject.toml
plugins: napari-0.5.6, napari-plugin-engine-0.2.0, npe2-0.7.7
collected 9 items

mantis/tests/test_acquisition_settings.py::test_config_settings PASSED                                                                                                                                                                     [ 11%]
mantis/tests/test_acquisition_settings.py::test_device_property_settings PASSED                                                                                                                                                            [ 22%]
mantis/tests/test_acquisition_settings.py::test_time_settings PASSED                                                                                                                                                                       [ 33%]
mantis/tests/test_acquisition_settings.py::test_position_settings PASSED                                                                                                                                                                   [ 44%]
mantis/tests/test_acquisition_settings.py::test_channel_settings PASSED                                                                                                                                                                    [ 55%]
mantis/tests/test_acquisition_settings.py::test_slice_settings PASSED                                                                                                                                                                      [ 66%]
mantis/tests/test_acquisition_settings.py::test_example_settings PASSED                                                                                                                                                                    [ 77%]
mantis/tests/test_acquisition_settings.py::test_demo_settings PASSED                                                                                                                                                                       [ 88%]
mantis/tests/test_cli.py::test_main PASSED                                                                                                                                                                                                 [100%]

=============================================================================================================== 9 passed in 0.59s ===============================================================================================================

@jeskesen jeskesen changed the title LF only acquisition with actual Mantis hardware. LF only acquisition with Mantis hardware. Jul 16, 2025
mm_config_file=mm_config_filepath,
lf_config_file=lf_config_filepath,
demo_run=demo_run,
enable_ls_acq=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now, eventually we'd like to be able to determine that from the acquisition config (settings) file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We'll put this on the to-do list for later. I have also been thinking that rather than instantiating 2 acquisitions, and disabling one, we could also just not instantiate the 2nd one... and that would mean that there would be now "disabled" state.


# Determine label-free acq timing
oryx_framerate = float(self.lf_acq.mmc.getProperty('Oryx', 'Frame Rate'))
oryx_framerate = float(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is no standard way to get the camera framerate in MicroManager - this will work for Spinnaker cameras which have a Frame Rate property exposed through the device adapter. Other camera manufacturers may call it something different. Still. I do agree with the change you are making here as self.lf_acq.mmc.getCameraDevice() is more general than Oryx. As a step further, maybe we can make a microscope_operations.get_camera_framerate() function which will standardize retrieving the camera framerate across the few different camera manufacturers we use at the Biohub?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty weak suggestion at this point - we have hardcoded device name at many places throughout the code, we can also clean these up in another PR, I know this is not the point of this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's note that for now, and deal with that when we're using a different camera.

# ls_image_saved_fn = check_ls_acq_finished

# Generate LF acquisition events
# Generate LF MDA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check if these are enabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't crash anything to generate an MDA that you're not going to run... but it is wasted computation and memory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd like to move this functionality inside of each acquisition class eventually... so I'll handle it then.

Copy link
Collaborator

@ieivanov ieivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good to me. I agree that is resolves #184. Let's aim to get to a point where we can stress test the pymmcore-plus acquisition engine on the mantis microscope with minimal software polishing to confirm that pymmcore-plus can do everything we need it. This will involve running a typical mantis acquisition (two arms, multiple channels, few hours imaging multiple positions) and an acquisition where we only use the LF arm. I think the only step towards that goal is finding a good data writer, correct?

@ieivanov
Copy link
Collaborator

Let me know if you need to me merge these changes, I can overwrite the failed tests check

@jeskesen jeskesen merged commit 36930a3 into czbiohub-sf:170-migrate-to-pymmcore-plus Jul 24, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants