Closed sfeister closed 8 years ago
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:
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):
- Navigate to the Neutrino v1.0rc source code directory
- sudo apt-get install python-sip-dev
- sudo apt-get install python-qt4-dev
- make -f nMakefile py
After this, 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
Reply to this email directly or view it on GitHub: https://github.com/aflux/neutrino/issues/28#issuecomment-46729133
Dear Scott,
very glad to hear you are working for the implementation of a camera support!
To be honest this was one of the ideas behind the generation of python bindings for neutrino (the others being automation and giving the user the freedom to implement/integrate plugins seamlessly).
In principle all of neutrino structure is being exported to the python module, so what you are trying to do is possible. However we switched not long ago to sip/libNeutrino from pythonQt, so the present state is not well documented (or at all ;-))
Don't hesitate to contact us if you need particular hooks integrated in the main source or if you need to be pointed to relevant parts of the source code.
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, glad you're using our program :) here is some help.
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 and please let us if you need something more. As @aflux said, scripting changed recently and user feedback is highly appreciated.
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, w.get("image")
returns nothing (I might expect it to return the buffer index), and w.set("image", 2)
does not work! Do you know of another way to select the image buffer in the various dynamic combo boxes?
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
Indeed, we had a discussion at the beginning, whether we should add a Mac version or not. We decided not. It seemed more important to us to offer a Linux version in addition to the MS edition, which is the most downloaded version.
We have more than hundred downloads a year from various institutions and companies. Nearly all of them use the MS version. So, at the moment it does not make sense to offer a third line. I am sorry.
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 great if you could share it.
A.
On 06/28/2014 03:10 AM, Scott F wrote:
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
— Reply to this email directly or view it on GitHub https://github.com/aflux/neutrino/issues/28#issuecomment-47414145.
@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, https://github.com/aflux/neutrino/wiki/neutrino-python
~A
On 06/30/2014 07:11 PM, Scott F wrote:
@aflux https://github.com/aflux I have started some help-oriented wiki pages of my experiences installing Neutrino / getting started scripting in the meantime!
https://github.com/phyzicist/wiktest/wiki
— Reply to this email directly or view it on GitHub https://github.com/aflux/neutrino/issues/28#issuecomment-47558389.
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:"
Any help you could give would be greatly appreciated!
Thank you,
Scott