scopetools / cudasirecon

3D Structured illumination microscopy (3D-SIM) reconstruction software
GNU General Public License v3.0
28 stars 9 forks source link

Scaling of initial K0 guesses with TIFF files #21

Open thomasmfish opened 4 months ago

thomasmfish commented 4 months ago

We are trying to compare cudasirecon output with that from softworx on some data we have already reconstructed with softworx. The cudasirecon is failing in a strange manner: we get a successful reconstruction but it appears to find stripes with exactly twice the expected line spacing. The the reconstructions have a small enhanced resolution but not the expected successful reconstruction.

We believe that the issue is that the initial k0 estimate is incorrectly calculated and the initial guess for the k0 position in pixels in Fourier space is incorrect. The angle is fine but the magnitude is half as big as expected.

I'm tagging @iandobbie as I'm working with him on this.

cudasirecon log (525nm) softworx log

thomasmfish commented 3 months ago

I've run this again with the data I've been told is better. I don't think the OTF is great on some channels but the 525 is looking good and has given good results, so I'm going to focus on that. Here's the FFT of two images that look a much closer match and don't have the blurring we've been seeing. Much more of what I called a "halo" on both, though definitely more significant with softworx. I have no idea why:

  1. softworx seems to be more resilient to lower OTF quality
  2. What this "halo" is (it doesn't just seem to be noise) and why is more prevalent in the softworx output

Softworx: FFT of 20221001160727_SR03G3_E4F_GR_FL_SIR

Cudasirecon: FFT of 20221001160727_SR03G3_E4F_GR_FL_recon

Here are the log files in case that's useful:

softworx log

cudasirecon log

config for cudasirecon

I still need to try the simulated data but that's for another day.

thomasmfish commented 3 weeks ago

Hi all, sorry for the radio silence on this issue. Ian and I have been investigating things and it looks like the main difference is that softworx has no way to specify the na or nimm parameters. However, I'm not sure that this is the entirety of the issue and it is hard to test since our system is has such different values.

One thing that I was unsure about is the apodization, as the options section of the logs we get from softworx contains:

  -inputapo 4
  -triangleapo

I'm not sure how those settings would map to cudasirecon, or if one of those settings overrides the other in softworx. However, it looks like in cudasirecon, m_myParams.apoGamma is never used (just passed to const_pParams_apoGamma) and apodizeoutput is always set to 2 (since the setting gammaApo has a default, see 1040 of cudaSirecon.cpp). Could this be affecting the output, perhaps more noticeably than for higher NAs?

I also wanted to mention the project I've been working on, called PySIMRecon, in case it is of interest to you. The idea is to wrap cudasirecon/pycudasirecon with Python to allow the setting of default values that match a microscope, along with OTFs, so that it can be easily used for automatic processing. It handles splitting and recombining DV files and has a couple of other tools in it too. Also, on a personal note, I am moving on from my current job at the end of this month, so I unfortunately won't be able to continue the project. However, I will be installing PySIMRecon as part of the automatic processing pipeline we use, so it should continue to be maintained and developed.