Skip to content
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

Artifact/Illumination correction in overlapping areas #210

Open
bellonet opened this issue Feb 12, 2024 · 2 comments
Open

Artifact/Illumination correction in overlapping areas #210

bellonet opened this issue Feb 12, 2024 · 2 comments

Comments

@bellonet
Copy link

bellonet commented Feb 12, 2024

I'm trying to use ASHLAR to stitch electron microscopy (EM) tiles, but although the stitching itself looks great, I don't think it offers the illumination correction needed.
The tiles (pre-stitched) are darker in the overlapping part (most probably due to double imaging of those areas).
Is there any parameter I can set to correct for those?

I didn't fully understand FFP and DFP, but when I tried to use them I got a black output image and a "Cannot cast ufunc 'true_divide' output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'" error correspondingly.

Thank you!

@jmuhlich
Copy link
Collaborator

Glad to hear Ashlar is working for your EM images. Ashlar can perform illumination correction with user-specified illumination profiles during final image assembly but it doesn't compute the profiles itself. For optical fluorescence microscopy our lab uses the BaSiC algorithm (https://doi.org/10.1038/ncomms14836) to compute illumination profiles retrospectively from existing image sets, but it is also possible to collect the profiles prospectively using a particular imaging protocol. The correction in Ashlar is applied according to the following equation from the BaSiC paper:

image

  • Icorr: corrected image
  • Imeas: measured image (your input image tiles)
  • D: dark field profile (--dfp in Ashlar)
  • S: flat field profile (--ffp in Ashlar)

Ashlar expects the --dfp image to have an unsigned integer pixel type that matches the input images. (Let me know if your input images are in floating point, and I can update the code to support that) The --ffp image must have a floating point pixel type. Both profile images must have the same dimensions as your input image tiles.

@bellonet
Copy link
Author

Thank you for the quick response.
Using BaSic to compute the illumination profile and setting dfp and ffp did improve the stitched image but the tiles overlapping areas are still noticeable. Maybe it's because my image comprises of only 6 tiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants