TheDeanLab / navigate

navigate - open source light-sheet microscope controls
https://thedeanlab.github.io/navigate/
Other
18 stars 5 forks source link

Slow Multichannel Operation in Continuous and perZ Z-Stack Modes #922

Open AdvancedImagingUTSW opened 2 months ago

AdvancedImagingUTSW commented 2 months ago

Describe the bug This has been something worth dealing with for a while now. When we operate multiple channels, there is a clear delay when switching between channels. This is most obvious when in the continuous mode, or the perZ Z-stack acquisition mode.

It appears the camera is timing out between acquisitions...

2024-06-18 08:53:45,737 - model - INFO - model: Navigate Model - Sent through pipe16
2024-06-18 08:53:46,238 - model - DEBUG - HamamatsuAPI: error message: -2147483386
2024-06-18 08:53:46,238 - model - INFO - model: Navigate Model - Running data process, get frames []
2024-06-18 08:53:46,238 - model - INFO - model: Navigate Model - Waiting 20
2024-06-18 08:53:46,739 - model - DEBUG - HamamatsuAPI: error message: -2147483386
2024-06-18 08:53:46,739 - model - INFO - model: Navigate Model - Running data process, get frames []
2024-06-18 08:53:46,739 - model - INFO - model: Navigate Model - Waiting 19
2024-06-18 08:53:46,814 - model - INFO - daq_ni: Waveform Template Name: Default
2024-06-18 08:53:46,817 - model - INFO - model: Navigate Model - Stopping with stop command.
2024-06-18 08:53:46,820 - model - INFO - daq_ni: Waveform Expand Num = 1
2024-06-18 08:53:46,820 - model - INFO - daq_ni: Waveform Repeat Num = 1
2024-06-18 08:53:46,857 - model - DEBUG - feature_container: running signal node: LoopByCount
2024-06-18 08:53:47,115 - model - INFO - model: Navigate Model - Running data process, get frames [17]
2024-06-18 08:53:47,115 - model - INFO - model: Navigate Model - Sent through pipe17
2024-06-18 08:53:47,116 - model - INFO - model: Navigate Model - Data thread stopped.
2024-06-18 08:53:47,116 - model - INFO - model: Navigate Model - Received frames in total: 18
AdvancedImagingUTSW commented 2 weeks ago

Writing waveforms to the daq causes delay between channels. It may be possible to not overwrite the waveforms if the two adjacent channels have the same exposure time. Otherwise, we would need to find another way to deal with daq tasks.

Would also be curious to hear if @ffvoigt, @AndrewGYork, @dpshepherd have any tricks to speed up generating and writing data to tasks with National Instruments-based cards. The only stupid approach I could think about is to dedicate a channel to each task. For example, have dedicated pinouts for CH0 remote focusing, CH1 remote focusing, CH2 remote focusing, etc., then combine all of the voltages with a BNC combiner prior to delivering it to the physical hardware. But that also seems egregiously stupid.