Closed wfeschen closed 9 months ago
Ah yes, I put that in, as I usually get circles in my images which take forever to solve. For me this worked like a charm. We could change it to make it optional, but most likely if we make the width a function of entrancePupilDiameter it should be fixed as well, right? Can you show what the problem is if you have a tiny probe? You can just drag and drop an image here.
I also see that there's a bug in the implementation, at the moment the random numbers are uniformly distributed over the entire image, also outside of the entrancepupildiameter.
I'll change these two things, can you take a look afterwards?
I updated the code. It solves the bug of having uniform imaginary noise over the entire probe and it convolves with a width that is dependent on the width of the illumination. I tried to run it with simulated data with a probe width of 5 pixels and that seems to work just fine. Can you take a look?
And this is after running
Also see test_initializationFunctions.py for an idea
I also noticed when doing this that changing entrancePupilDiameter at the moment is extremely unintuitive. As long as you never change it it can be fine but simply changing it in the script has no effect. That's a pretty serious bug and I think we should actually rewrite initializationFunctions.py.
Hi Dirk,
changing entrancePupilDiameter works for me, but I have to use the property of the experimentalData object.
# Type of the initial probe
reconstruction.initialProbe = 'circ'
experimentalData.entrancePupilDiameter = 10e-6
# Use simple ones for the initial object
reconstruction.initialObject = 'ones'
reconstruction.initializeObjectProbe()
Best, Wilhelm
@wfeschen says:
Hi Dirk, I did some testing with the new function and for me the new implementation was unfortunately not convenient. For the test script with the really small probe any smoothing of the probe leads to a bad reconstruction. While the hard edge of the probe definitely shows a better reconstruction. I would suggest having both options available in the code
If this is the case, let's make it an option indeed.
@larsloetgering : Did you ever try to smoothen the edges of the probe? I noticed that it gave me better reconstructions if the parameters are not entirely correct, aka when you're building a new setup. With the sharp edge I saw a lot of circles being drawn in the object which only slowly disappear. However, apparently if you have a very small probe it will make it worse.
I recently tried to reconstruct a dataset with a really small probe (20 pixel diameter with a detector size of 256x256). Unfortunately, the circ function does not work for small diameters. The issue is the gaussian filter. I suggest making the gaussian filter an option or even remove it.
Here the problematic code from the initializationFunctions.py file Here