Edit>invert does not invert the values

Hi all,

I am trying to invert pixel values of 16 bit .tiff image
Currently fiji assigns the maximum value to white pixels of the original image and while edit>invert or invert LUT and apply LUT change the visual appearance of the image the values are not changed. Tried also changing the the background options in Binary menu - does not work as well…

Any ideas on how to solve this problem?

Thanks!

Hi @Belegon,

I generated a 10 x 10 image with mostly zeroes and some random values in a line, the results to the left or it are using the Image > Transform > Image to Results command so you can see them.

I then duplicated the image and inverted it using Edit > Invert and the values were exactly what I expected, mostly 65535 with some values equal to 65535 minus the values in in my original image. I’ve put a snapshot image below to demonstrate.

How sure are you the values in your image aren’t changing? Maybe you could upload your image so we could see if we get the same behaviour.

lowest_10s_D1.tif (15.9 MB)
Thanks @lmurphy !
I am trying to subtract the background values from the individual slides there via math > subtract, but the measure gives me constantly the original pixel value after the inversion as well…

Hi @Belegon

Not sure why if I haven’t come across it before or if I just forgot but it seems Edit > Invert works on the min and max values of your image. So when I invert your image, the values are changing but only a little as the min and max of your original image are 61537 and 65535 (saturation) respectively. I’ve put the histogram of your image before and after inversion so you can see this.

image

Could you explain a little more about what you are trying to achieve with the subtraction and then inversion? If what you want, I’ve added a result below that hopefully might work for your goals? To get this I subtracted the minimum value of your original image and then inverted it.

lowest_10s_D1.tif (1.1 MB)

2 Likes

Thanks a lot! You helped me realise that the dynamic range is rather artificial.
I want just to subtract the background, inversion is not necessary, the problem is that the software that created the 16-bit assigned 61537 to what is supposed to be 0.
@lmurphy A follow-up question - if I subtract 61537 from the image I get only the range it could record, but the visual result is black - how could re-optimize the range to have 0-black and 3998-white ?
Thanks!

1 Like

Hi @Belegon,

If you open the Brightness and Contrast window (Image > Adjust > Brightness and Contrast or CTRL + SHIFT + C) and click ‘Reset’ it will be visible.

1 Like