Skip to content
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

connect Andor Ultra888 with pylablib on Jupyter notebook #35

Open
Buantum opened this issue Mar 8, 2023 · 11 comments
Open

connect Andor Ultra888 with pylablib on Jupyter notebook #35

Buantum opened this issue Mar 8, 2023 · 11 comments

Comments

@Buantum
Copy link

Buantum commented Mar 8, 2023

I try to use jupyter notebook to connect pylablib with andor camera and change path where my andor solis located. but it still runs likes this
image
what wrong with it? However,I‘d like to know what‘s means of
cb55a35edd0c35384947e419b7e2b78
because I find the example which path is Andor soli but not Andor SDK3. did it just mean where the dlls of sdk3 located ?
’’thanks

@Buantum Buantum changed the title Jupyter note connect Andor Ultra888 with pylablib on Jupyter notebook Mar 10, 2023
@AlexShkarin
Copy link
Owner

Hello!

As far as I can tell, Ultra 888 could be an SDK2 camera, not SDK3 (these both come from Andor, but the interfaces are completely different). So could you try running the following:

import pylablilb as pll
pll.par["devices/dlls/andor_sdk2"]="D:/Andor SOLIS"
from pylablilb.devices import Andor
print(Andor.get_cameras_number_SDK2())

and see what number it prints?

Alexey.

@Buantum
Copy link
Author

Buantum commented Mar 16, 2023

it prints 1, thanks a lot!
image

@AlexShkarin
Copy link
Owner

Great! To make sure that the connection work, you can try to execute something like

import pylablilb as pll
pll.par["devices/dlls/andor_sdk2"]="D:/Andor SOLIS"
from pylablilb.devices import Andor
with Andor.AndorSDK2Camera() as cam:
    print(cam.get_full_info())
    print(cam.snap())

Regarding the related issue (AlexShkarin/pyLabLib-cam-control#1): since your Andor SOLIS is installed in a non-standard folder, the software can not find the necessary libraries (that is also why you need to specify pll.par["devices/dlls/andor_sdk2"] in the Python code). To fix that, you can find settings.cfg file inside cam-control/cam-control folder and add a line

dlls/andor_sdk2 D:/Andor SOLIS

Afterwards, the software should find the camera. Just in case, you can also run detect.exe before control.exe, so that it would re-scan for all available cameras.

Let me know if that works!

Alexey.

@Buantum
Copy link
Author

Buantum commented Mar 16, 2023 via email

@AlexShkarin
Copy link
Owner

I'm glad it works!

Regarding the cam-control: do you mean real-time operation? There are some basic algorithms built-in, such spatial band-pass filtering, background subtraction, and rolling average/median/min/max/standard deviation. In addition, you can write your own filters in Python.

However, I would recommend using these only to do some basic real-time image manipulation to quickly make sense of the camera data during the experiment. In general, I would suggest saving the raw camera data and process it in the software of your choice (e.g., Python, Matlab, ImageJ). This way, you can always try a different analysis scheme without having to re-take new data.

Alexey.

@Buantum
Copy link
Author

Buantum commented Mar 20, 2023

Thank you for your enthusiastic answer!
In our lab,we want to manipulation the real-time image with some easy operations to witness some fast process in real-times and then determine the parameters of next step. In our previous setting in Labview, the operations are quickly completed and so ignore the time.
Thanks for your reply, and I will learn the filter.

@Buantum
Copy link
Author

Buantum commented Mar 20, 2023

I have viewed base.py in filters. It looks that if I want to manipulate image autonomously,I just put my code into process_frame() in each class?

@AlexShkarin
Copy link
Owner

No, you don't need to alter the existing classes. You can just define a new class in a new file located in the same plugins/filters folder. To get a better idea, you can check out template.py in the same folder as an example.

It looks like a single-frame filter (defilend in TemplateSingleFrameFilter) might be enough for you. This kind of filter simply takes a single image (a new frame) and returns a modified image which is displayed in GUI. To define it from the template, you can do the following:

  • Make a copy of the template.py file in the same folder with an arbitrary name (e.g., myfilter.py)
  • Uncomment _class_name="template" line inside the TemplateSingleFrameFilter class definition. It is also a good idea to rename it to something else, e.g., _class_name="myfilter"; otherwise, there might be conflicts when two filters define the same name
  • Optionally, you can also change _class_caption and _class_description strings to better present your filter in the software.
  • Finally, most importantly, you need to alter the process_frame method to do the image manipulation you want.

I hope that helps!

Alexey.

@Buantum
Copy link
Author

Buantum commented Mar 21, 2023 via email

@AlexShkarin
Copy link
Owner

I'm not sure exactly what you mean... Could this be realted to external / internal camera triggering? You can change these in the Advanced camera settings and see if it has the effect you want.

@Buantum
Copy link
Author

Buantum commented Mar 22, 2023 via email

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

No branches or pull requests

2 participants