-
Notifications
You must be signed in to change notification settings - Fork 10
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
Further features #290
Comments
Finding the beam center, displaying a running average, and thresholding the incoming data are implemented. Support for circular ROI's is nearly done, all that's left to do is actually compute and apply the mask (which should be easy, but it's late 😛 ). I also want to clean up the GUI controls for it, but I think that would take a bit of refactoring, which probably belongs in another PR. WRT point 2., do you mean displaying the running std/var/min/max over an ROI, i.e. scalar values? Or computing them for each pixel and displaying them as images? The code is in the mid_special_suite branch if you want to have a look. It may be completely broken on systems other than my own though. |
Thanks @JamesWrigley for the nice work. I have few questions.
|
Impressive work, James! |
Cool, looks very nice. I'll try to give it a closer look before the weekend. |
Just in this special suite for now, but I could certainly extend it to the ImageTool as the next step. I think the nicest way would be to add an extra widget to the ROI controls to allow the user to select the shape of the ROI they want. That would need some modification to the
Ah, no. I actually wasn't aware that EXtra-foam was capable of finding the beam center, where can I find the code for that? I tried grepping the codebase for 'beam' and 'center' but couldn't find anything.
Absolutely terrible 😛 Like, 0.5 - 1 Hz on my decently powerful i7. Is there another way to assemble the image that would be faster? And finding the beam center is also really slow, on my machine it takes ~25s. On the plus side it should be easy to parallelize parts of it and run it in a separate process so it doesn't block the GUI. Another option would be to implement it in the C++ core or use Cython (not sure how complicated either of those would be). |
Finding the beamcenter is something you would do once at the beginning of each shift. No problem if that is not super fast. |
Something like this where the assembler is implemented in C++. Take a look at EXtra-foam/extra_foam/geometries/__init__.py Line 336 in 976bce5
I think |
Detecting beam center is already implemented https://extra-foam.readthedocs.io/en/latest/image_tool.html#concentric-rings, which takes a few hundreds of milliseconds, depending on the image size. I don't see the point of reinventing the wheel here. |
Adding the circular ROI is a good progress 👍 . But I would suggest to think about corner cases (e.g. on the edge of an image) and performance. |
Ah thanks, will look into that. WRT finding the beam center, I believe the reason for this different method is to handle images that don't have well-defined concentric rings. I played around a little with the concentric ring feature on the dataset I'm testing with, and the calculated beam center isn't that stable if you play around with the settings for prominence/min. count etc (though this could also be because of my inexperience with the tool). |
The reason for the hyperparameters |
If there are no rings, one could simply find the center of mass of the spot, which is how people do in experiments. |
Ah, I see. @jo-moeller, has that already been tried? I could test it if not. |
Hey, The other type of samples are unordered or non-crystalline. They might have some oscillating features, like the example data set we used. Or only very broad rings. They might also just have a I(q) ~ q^-4 power law all over the range of the detector. Here the beam center finding that I suggested normally works quite well. Center of mass could also work, but I think the one that James now implemented works better if there are some features like oscillations. Some example plots are in our beamline paper, figure 10: |
Maybe it would be worth converging both approaches into one feature? |
Yep, can look into that :) |
Hi, as previously discusssed with @dallanto and James, we would need a few additions for online analysis with extra-foam at MID.
Some good to haves:
The text was updated successfully, but these errors were encountered: