micro-manager / pycro-manager

Python control of micro-manager for customized data acquisition
https://pycro-manager.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
159 stars 50 forks source link

Exposure time is not correctly set #622

Closed ieivanov closed 1 year ago

ieivanov commented 1 year ago

Exposure time is not correctly set as given in channel_exposures_ms when acquisition uses z-sequencing. Working to fix this. Here is a script to replicate this bug:

from pycromanager import Core, Acquisition, multi_d_acquisition_events

mmc = Core()

mmc.set_exposure(10)
mmc.set_property('Z', 'UseSequences', 'Yes')

events = multi_d_acquisition_events(
    z_start=0,
    z_end=5,
    z_step=1,
    channels=['DAPI', 'FITC'],
    channel_group='Channel',
    channel_exposures_ms=[20, 30],
)

with Acquisition(
    directory=r'D:\automation_testing', 
    name='debug',
    show_display=False
) as acq:
    acq.acquire(events)

with acq.get_dataset() as ds:
    metadata = ds.read_metadata(channel='DAPI', z=0)
    assert metadata["Exposure"] == 20

    metadata = ds.read_metadata(channel='FITC', z=0)
    assert metadata["Exposure"] == 30
henrypinkard commented 1 year ago

Cool, let me know if you need help

ieivanov commented 1 year ago

@henrypinkard I have a problem running MM from source, seems like I'm missing several classes used in the LightSheetStackTests module (e.g. ImagePlus, ImageStack, ImageProcessor, etc). Are these part of https://github.com/micro-manager/LightSheetManager?

henrypinkard commented 1 year ago

Those are part of ImageJ. I was using them to be able to test the lightsheet deskewing module I recently added (kust to display some images). ImageJ is not a dependency of PM directly, and I think for now best not to make it one. I thought I had commented these out--feel free to just do that