-
Notifications
You must be signed in to change notification settings - Fork 1
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
Status of Python Scripting? #28
Comments
Good news -- we were able to get past the error mentioned above. We did this in a version we have compiled from source. Here are the steps that worked (Ubuntu 13.10 64-bit):
After this, "PyNeutrino.so" was created, and following the wiki instructions did not give any errors at "import PyNeutrino as pn". I'll keep you posted with how our python scripting goes. Thanks, Scott |
On 06/20/2014 11:33 PM, Scott F wrote:
Dear Scott, very glad to hear you are working for the implementation of a camera To be honest this was one of the ideas behind the generation of python In principle all of neutrino structure is being exported to the python Don't hesitate to contact us if you need particular hooks integrated in A. |
It's great to hear that you are supportive of our effort! We are very appreciative to you for developing this resource. In fact, if you grant me wiki access, I would be happy to add a page or two for describing how we installed Neutrino from source on our system (there were a lot of dependencies!) Also, I could add potential future python scripting examples, to help future scripters. Following the lead of the "neutrino python" wiki page, I am now at the point where I can call a Neutrino instance from python, open a file, and open the various windows, such as the Wavelet window. I can execute certain functions from python, such as the Wavelet "Unwrap" function. I am using the latest version of Neutrino pulled from GitHub. I am going to take you up on your offer to let me know about particular hooks! Regarding python scripting, my biggest questions right now are:
Thanks again, Scott |
Hi Scott,
there's a neutrino.py in the sip folder that will open a neutrino win (n) and a small console (c) where you can send python commands to n. I use that for tests. here is a small example of what you can do. import numpy as np
n.openFile("/Users/tommaso/Desktop/tir46.sif")
w=n.Wavelet()
w.button("doWavelet")
print w.set("synthetic",False)
print w.get("thickness")
w.set("thickness",50)
print w.get("thickness")
data = np.array(n.getData())
print data.shape
data2=np.fft.fftshift(np.log(abs(np.fft.fft2(data))))
n.setData(data2.tolist()) Please note that I fixed a small bug that prevented to show the image data2, so you have to download the lastest snapshot and recompile. Otherwise you have to manually move the sliders of the colorbar to see the image Hope this helps |
Wow, this is really helpful, and I've made a lot of progress with scripting our interferometry analysis. Thanks! One more python obstacle that I'm running into is changing the image buffer selections within combo boxes (e.g. "0 : ImageA, 1 : ImageB, 2 : phase, .."). For example, in the Wavelet window, Also, if you don't mind, I have two general questions about the Wavelet package and algorithms. First, what does the "synthetic" checkbox mean? Second, have you looked at how Neutrino phase reconstructions compare with those from other interferometric reconstruction software (such as IDEA -- http://www.optics.tugraz.at/idea/idea.html)? Are there any known resultant differences between Neutrino and other interferometry software / any known issues? Thanks again! Scott |
Ok, I corrected the bug (still coming from the switch from pythonqt to sip/pyqt), you can grab the latest snapshot and recompile now you can get/set image comboBoxes and you can also use geData to get the array in python from PyNeutrino import *
import numpy as np
n= neutrino()
n.openFile('/Users/tommaso/Desktop/tir52.sif')
w=n.openPan("Wavelet")
print w.get("image")
d=np.array(w.getData("image"))
print d.shape The synthetic checkbox produces a sythetic interferogram based on the recovered phase and contrast of the fringes (called quality in neutrino). it's just quality*cos(phase). It's just cosmetic stuff , but it's sometimes useful to have a look at what the algorithms actually "sees" We didn't benchmark with Idea, we had some student using it here at the lab, but I don't like the closeness of their program. Moreover a couple of years ago (11/18/06) I contacted them to have a Mac port of their program but the answer was
They also refused help. Tommaso |
Thanks for making those fixes! It works now. Just as update, with all your help we've really made some good progress scripting. I'm able feed images from python into Neutrino, perform Wavelet analysis, unwrapping, and reference subtraction, and then get the results back in python. In a loop of 80+ images, that's a good bit of Neutrino automation! Since I deliberately call any "file open" functions without involving Neutrino, it's also potentially a good foundation for real-time analysis. Furthermore, with certain parameters the Wavelet results seem qualitatively similar to what we had seen in IDEA (I have not yet checked quantitatively). Thanks so much for your efforts in making this open source project. I'll continue to send you updates and/or bugs and requests. -Scott |
Scott, great to hear that! As soon as I've figured out how to add you as a wiki mantainer, it'd be A. On 06/28/2014 03:10 AM, Scott F wrote:
|
@aflux I have started some help-oriented wiki pages of my experiences installing Neutrino / getting started scripting in the meantime! |
Great job! I linked it from the neutrino-python wiki page, ~A On 06/30/2014 07:11 PM, Scott F wrote:
|
Hello!
My colleagues and I have been using Neutrino's wavelet package to analyze interferograms, as an alternative to the IDEA software (http://www.optics.tugraz.at/idea/idea.html). Our interferometric setup is described at http://arxiv.org/abs/1406.3639. We are interested in developing Neutrino for real-time analysis of interferometric camera images.
Working through this problem, I have come up with a question for the Neutrino developers. What is the status of the Python scripting? Is it functional?
I have seen references to a GUI element related to the python shell, but it does not appear to be in the release. I am running v1.0rc release on 64-bit Ubuntu. When I follow the instructions on the wiki (https://github.com/aflux/neutrino/wiki/neutrino-python), I get an error. Here is what I have done:"
"ImportError: No module named PyNeutrino"
Any help you could give would be greatly appreciated!
Thank you,
Scott
The text was updated successfully, but these errors were encountered: