-
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
Acquisition doesn't acquire images #42
Comments
Seems like this was caused by a bug in Java that I still don't understand, but should be now fixed. Will be in Micro-manager nightly builds after (micro-manager/micro-manager#822). In the mean time, you can replace all three of NDTiffStorage.jar, Pycromanager.jar, and AcqEngJ.jar with their latest versions, available here |
Is this bug fixed? |
With 20200605 I still have the same issue. |
Hmmm. Unfortunately I cannot reproduce this anymore on either Windows or OSX. Is it possible one of the older versions of the libraries remains behind? Maybe you could try installing 20200605 into its own new directory? I wonder also if anything suspicious shows up in your core log (in the CoreLogs folder in your mm install directory) |
I uninstalled micromanager, emptied the bin, and installed 20200606, and the issue persists (win10). The log is: |
It is behaving exactly the same if I replace |
I see near the top of the core log: |
If so, I would guess that your project may be linking to an older version of the dependency used for writing data. The previous bug I fixed lived inside the NDTiffStorage.jar library. So the acquisition event is received, and the image is acquired, but it cannot save so it does not display. Ideally, this would throw an error, but unfortunately I couldn't get it to log an error, as it seemed to be bug within Java itself. |
I installed it from https://valelab4.ucsf.edu/~MM/nightlyBuilds/2.0.0-gamma/Windows/ and run from the start menu. |
The NDTiffStorage.jar in C:/Program file/Micro-Manager-2.0gamma/plugins/Micro-manager has version 0.2.6 |
That's strange. @nicost do you have any idea why |
Actually, I think you might be right that the problem is somewhere in the acquisition events, because I don't see the information about images actually being acquired in your corelog. I made new versions of both the python and java side with logging related to acquisition events. The python side is in pycromanager 0.3.2. This time run your acquisition with |
I got it to work by replacing |
Mine says: |
Ah okay great! Then that suggests this is purely on the Python side, and that you're right, the events never actually get sent over. Events are designed to be constantly pulled from Maybe this is another such instance. Still not sure why I didn't see it on windows though. Which version of Python are you using @impact27? |
I think the multiprocessing problem is unrelated to pycromanager so micro-manager/micro-manager#822 solved this issue. It runs with python 3.7.6 For the story: I am running with ipython and it doesn't work there on windows. import multiprocessing
def say_hello(pipe):
pipe.send("Hello")
if __name__ == "__main__":
parent_conn, child_conn = multiprocessing.Pipe()
processor_thread = multiprocessing.Process(target=say_hello,
args=(child_conn,))
processor_thread.start()
print(parent_conn.recv())
processor_thread.join() But this doesn't: IPython 7.13.0 -- An enhanced Interactive Python.
In [1]: import multiprocessing
...:
...: def say_hello(pipe):
...: pipe.send("Hello")
...:
In [2]: parent_conn, child_conn = multiprocessing.Pipe()
...: processor_thread = multiprocessing.Process(target=say_hello,
...: args=(child_conn,))
...: processor_thread.start()
...: print(parent_conn.recv())
...: processor_thread.join() |
Glad you were able to figure it out. It's unfortunate that multiprocessing is so non-intuitive on windows. Might be worth thinking about alternatives. For acquisition events it would be pretty easy to swap in multiple threads instead of multiple processes, and I doubt there would much (if any) performance hit, but image processors and acquisition hooks run by the same mechanism, and if using both at the same time global interpreter lock blocking could become a problem. I made a new issue to think about this more (#46). Let me know if you have any ideas. |
Multiprocessing.dummy is using threads so using threads would be easy as it has the same api as multiprocessing.
|
Actually I think I was mistaken, the problem is with the editor I am using. I created a PR there (spyder-ide/spyder-kernels#229). I think the multiprocessing part of the bug really doesn't have anything to do with micromanager. Indeed this works:
|
Ok great. In that case maybe there's not so much of a motivation to switch to |
Hi, I was super excited to see this tool! I seem to be having the same issue described originally by @impact27. Multi-d acquisition works in the desktop app for me, but not when I run the following script:
with
(FYI, I got an error with debug in acquire.py line 20, so I changed to: The script completes, but no images seem to be acquired or saved. CoreLog: CoreLog20200619T095812_pid11668.txt I am using Windows, python 3.7.6, micromanager version 2.0.0-gamma1 20200618, pycromanager version 0.3.3 (and from source). Using Any ideas what could be going on? Many thanks! |
Not quite sure. What do you mean by "desktop app"? From an IDE? And then when it doesn't work, that's running the script from the command line? |
Thanks for the quick response! By desktop app, I just meant in the micromanager GUI application itself, where everything works fine. Yes, it is when I run the script in the command line that it doesn't work. |
Got it. Those are actually running different libraries under the hood, so working in MM GUI doesn't tell us much. I think this issue might be on the Java side. Could you try running with different python setups to see if that changes anything? In addition to running script, you could try entering python on command line and typing each command in the script individually? And then maybe from an IDE like pycharm? |
If none of those work I can add some more logging into the Java side |
Just saw and fixed another bug that acquisitions can fail silently if there's not enough disk space. For performance reasons, the saving files allocate much more space than needed (4GB) before truncating. Is it possible you're saving to a HD that's almost full? |
No luck for me with pycharm or the command line: still no images saved and logs, etc. look the same. I tried saving to another disk with plenty of space and no luck there either. I agree it would be nice to log the Java side - would the relevant "receiver" of the messages be in the core micro-manager repo or here in the ZMQ Java classes? |
It would be dispatched through the ZMQ Java classes to the acquisition library, and eventually be saved by this data writing library, and displayed by this viewer library. Do you have experience with Java development? |
I only have a little experience with Java, so maybe above my head.. |
Okay, could I remote control your system with teamviewer to investigate? |
@jmmanley still having an issue with this? |
Hey @henrypinkard, sorry for the delay! Just tried again. Not sure what’s changed, but things seem to be working with the latest nightly build! :) |
With micromanager I can acquire a stack of 10 images:
![mm_interface](https://user-images.githubusercontent.com/6740194/83734273-0c776580-a64f-11ea-83bb-a5de2580cf0c.png)
I would like to do the same with pycromanager. I replaced the acquisition engine as instructed in #41 and run this code:
A folder is created (
![interface](https://user-images.githubusercontent.com/6740194/83734265-0aada200-a64f-11ea-8756-f1c852b59465.png)
C:/Users/Quentin.Peter/Desktop/tmp0/acquisition_name_1/Full resolution
) and the following windows appears:But then nothing happens. The python code is stuck in
Acquisition.await_completion
. If I try to close the window, it asks if I want toFinish acquisition?
and I I press OK, the python code finishes.The text was updated successfully, but these errors were encountered: