-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full/advanced examples - interact with MM's preview window? #66
Comments
Have you loked at Pycro-manager's acquisition functionality? This provides many of the same features as the Java APIs, though the underlying code is separate from that running the micro-manager GUI. This API was designed to be more concise than calling all of the Java APIs. Alternatively, since it looks like you're basically just trying to run live mode from a script there, you should also take a look at Napari, which would serve as a better matplotlib alternative. |
Thanks for the suggestions, @henrypinkard! I haven't really looked at Regarding my original question - is there any way to snap an image, and load the data into |
I am also not familiar with how the Though |
Thanks for the clarifications @henrypinkard! I’ll probably look into the Regarding your comments about |
Yes, this should all be fairly easily doable through the acquisition interface. You'll want to create your own customized acquisition events, one for each image you record. You can set a different exposure time for each event, and you can specify custom properties to control the filter wheel, or treat this as a channel in MM. You can specify custom |
@henrypinkard ... sorry to follow up here, but I tried to use import pycromanager as pm
import numpy as np
#from pathlib import Path
if __name__ == '__main__':
#cwd = Path.cwd()
exposures = np.linspace(100, 1000, 10)
with pm.Acquisition(directory='.', name='pycrotest') as acq:
events = []
for idx, exposure in enumerate(exposures):
evt = {
'axes': {'exposure': idx},
#'properties' for the manipulation of hardware by specifying an arbitrary
#list of properties
'properties':
[['SaperaGigE', 'Exposure', str(exposure)]]}
events.append(evt)
acq.acquire(events) which throws the following exception
I was following your example, so I'm not quite sure why the exception is raised. |
Are you running latest nightly build of micro-manager? |
I installed MM at the end of May
I'll upgrade later today and will report back. |
@henrypinkard - thank you for the prompt response - I truly appreciate it. I got things to work with the latest nightly install, i.e.
However, looking at the tif file that is generated from the script above, it's only one image (with the first exposure set correctly - in this case100 ms), although I was trying to create 10 events/images with varying exposures. I had assumed that axes correspond to axes of a HyperStack? I am probably overlooking something obvious? |
Set |
Thank you for the suggestion. After setting In case this is of any relevance, I'm on Windows 10 and am running Python from a conda environment (the Python version is 3.8.3) |
So you get only two frames when adding the exposure, but if you delete the |
No. I switched over to MM's democam, and removed almost everything:
I get 10 events, but only a single frame is generated; renaming to a different channel does not change the outcome. |
Thanks for doing that. This was a small bug unrelated to exposure that is now fixed. It will be available in the nightly builds in a few days after micro-manager/micro-manager#904 merges. In the mean time, you can workaround around by adding
It's at least fixed on the demo camera now. Maybe there is still something remaining for your actual system |
@henrypinkard ... thank you for the prompt response! I can confirm that adding |
Hmm maybe this a problem with your camera device adapter then. Try running |
I get the same behavior for the GigE Camera Adapter distributed with MM as for our internal adapters (the latter are necessary as the MM GigE adapter doesn't produce images for our camera due to timeout issues). There aren't any errors on the core logs for the MM distributed adapter; in all cases, only 2 frames are generated. PS: The |
The acquisition code is internally calling that method, along with |
hm - I'm not sure what context you're referring to - the |
No acquisition involved. Does this work differently with the two cameras
|
Thanks for the clarification - this is what I thought you had in mind, but I wasn't 100% sure. And yes, this works as expected (replacing |
In that case I'm not sure what to suggest next, aside from remote controlling your system to run from source and take a look. Would this be possible? You can email me to talk set up: hbp [at] berkeley [dot] edu |
Got it - thanks. FYI, the device in question is a Teledyne DALSA Genie Nano GigE machine vision camera. |
Turns out it was a bug in the acquisition engine that only comes up with certain cameras. Now fixed and will be in nightly builds after this PR merges (micro-manager/micro-manager#906) |
I am currently looking into
pycro-manager
and was wondering whether it is possible to automate image acquisition while showing the images using micro-manager's own preview windows (MM is already open, which would make this an alternative to matplotlib)The low level example works well, and I have started to look into
MMStudio
via Micro-manager Java APIs. While I have locatedDisplayManager
,DataManager
,Image
,DataStore
,DisplayController
etc., I have thus far been unable to open a new (or even interact with an existing) preview window.I realize that
pycro-manager
is fairly new and some interfaces may not be complete, and it may not be possible to instantiate some objects from Python? There aren't many examples to go from right now so any pointers would be appreciated! Thanks!PS: Here's the extent of what I've located
The text was updated successfully, but these errors were encountered: