Creating Z project from stack changes brightness of slices in original stack


I am making a z project from a series of images I collected in a single z-stack and image J is doing a weird thing where when I create the project the resulting image is dark in regions that were bright in the original stack and when I go to look at the original stack certain slices are very dim, almost black in some cases. If I close the stack and reopen it the image slices are all back to their normal brightness but if I try to make a z-project again the same thing happens. This happens when I try a MAX, STD and AVG Z-project.

Basically, I take a number of slices from my original stack to make a Z-project. Prior to making the z-project every slice is the same brightness. Once I make the z project the resulting image is dark in regions it shouldn’t be and my original stack, that had images of the same brightness before, now has images in the stack that vary from their original brightness to completely black.

This is probably something simple in the program I have overlooked but if anyone can help me I would very much appreciate it!

Welcome to the forum, @scottaskinosie!

Please check a couple of things:

  • In each window, there is an informational line of text below the title bar, above the image proper. It should start with something details like “256x254 pixels; 8-bit”. Do you see the note “(inverting LUT)” after the bit depth?

  • If you press Shift+C for the Brightness/Contrast dialog, what is the range of your data, before and after the projection? You may need to click the “Auto” button to rescale the display range to match the data range.

Note that if you mouse over the image, ImageJ reports the pixel values in the status bar area of the main ImageJ window. You can use this to verify that the math is correct behind the operations you are performing (which if it is, means this is a display issue rather than a computational one).

If you could share one of the original files, and/or post some screenshots, that might also help us diagnose the issue better.

1 Like

Thank you Chris!

I did a little bit of work with it as per your instructions and here is what I found.

  • It does not say inverting LUT
  • The brightness levels are different from the original stack data. And, after I make the project from the original stack data and the brightness of the images in the original stack change to be not as bright, the values of each individual slice in the stack vary. If I hit auto on the brightness adjustment it brings the brightness back up to where I want it but as soon as I move to the next slice it reverts everything back to the dark state it was in before. Nothing I have tried as far as changing the brightness will stick.
    –an additional note I noticed is that this change only happens when I have the “adjust threshold” window open. I am trying to measure areas of fluorescence above a certain threshold in stacks and in my z-projects but if having the threshold window open is going to cause all of my slices to change in brightness that interferes with my ability to measure consistently:(

My wording may be a bit convoluted, if I can clarify please let me know. Thank you again!

It sounds like the data range across different slices varies a lot. ImageJ always scales image stacks consistently, meaning it will not autoscale per slice. This is a good thing, since it help you avoid comparing apples to oranges by eye.

If you really want to normalize the appearance of all the slices, you can use the Enhance Contrast command (press L for the Command Finder). But that will change your pixel values, and you will not be able to quantitatively analyze them in a statistically valid way after that.

Thank you again Chris!

Is there a way I can see if the quant does in fact differ between two slices? I think it is unlikely in this specific situation. The brightness varies drastically slice to slice and each slice is only 0.2 um thick and the protein I am following is homogeneously spread out in the area that I am looking. If there is a large difference it would be good to know because I would suspect something may wonky with my camera.

You’re welcome! My name is Curtis.

When you mouse over the pixel values, the value under the cursor is displayed in the status bar area of the main ImageJ window. If you press the Enter key, the main window will come to the foreground.

You can also run the Analyze :arrow_forward: Histogram command to inspect the histogram of pixel values.

Thank you Curtis! (I’m really sorry to call you Chris) I really appreciate the help!!!

I had a look at the values associated with pixels in my stacks and they are pretty close to each other, only about a 100-200 value difference (a slice that looks okay is at 2268 but the next slice that is dark is at 2095) and that is consistent across the image from the areas that I have tested. The slices that I have issues with only go dark when I have the threshold adjustment window open, if I close that window and hit auto on brightness adjustment the slices look good again, but as soon as I open the threshold adjust window they go dark again.

OK, maybe post a sample image stack then? And take some screenshots of A) what you are seeing that is unsatisfactory; and B) what you would like to see instead (e.g., by manually adjusting B&C). Then we can dig into the details of why it is happening, and then create a workflow which does what you desire, and/or fix any bugs which may be tripping you up.

In general, see Bug reporting best practices for advice on creating a Minimal, Complete, Verifiable example walking us through your problem.

1 Like