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

negative pixel values after alignment #32

Open
JohannaRahm opened this issue Mar 8, 2023 · 1 comment
Open

negative pixel values after alignment #32

JohannaRahm opened this issue Mar 8, 2023 · 1 comment

Comments

@JohannaRahm
Copy link

Hi,

thanks for creating this very useful tool! I want to apply pystackreg to register two microscopy images. The reference image has a high and the second image has a low SNR. However, after alignment, negative pixel values appear. I followed the suggestions in issue #8, but could not get rid of the negative values. Therefore, I would be very grateful for your input on how to fix this!! Attached is my code and two example images.

As the images differ drastically in their pixel value range (high SNR:0-340, low SNR:0-34), I found it to be useful to stretch the pixel values across the entire bit depth (0-65535), learn the registration based on the stretched images, and apply the registration on the non-streched 2nd image. This reduces the number of negative pixel values slightly. Atm, I am clipping negative values to zero, but would prefer if negative values could be avoided in the first place. Without the stretching approach, the registration is unstable and applies an incorrect large shift to the 2nd image.

register_images_negative_values.zip

pystackreg version: 0.2.7

Best,
Johanna

@fischi1611
Copy link

The Solution for this Problem can be found in an older version of the documentation:

https://pystackreg.readthedocs.io/en/latest/tutorial.html#clipping-of-negative-values

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