# Heatmap Generation

Hi,
I’m trying to generate heatmaps for images similar to those attached where the brown staining is illuminated as red and the regular tissue is blue. I’ve tried converting to greyscale and then using LUT’s as well as a script on MATLAB, but a common problem is the blue areas (which I don’t want to be “hot” on the heatmap) have a similar pixel intensity as the brown ones when converted to greyscale and thus are illuminated red. Any thoughts?Uploading: 70079A.tif…

Hi Jeremy,
it looks that your image example was not uploaded. Have you tried to convert the image to HSV color space and do heat map generation based on the Hue channel? In this case, brown colors should be ~30 degrees, while the blue color at ~240, which should give good separation for the heat map.

If you are only interested in the brown and want to heatmap a single channel image, I would use the Image->Color->Color deconvolution tool to extract “DAB.” Convert that to greyscale, then apply the desired LUT. The intensities should only be relevant to DAB at that point.

If you also want to include other channels, you might want to try image math, and multiply the DAB image by a set amount and add it back to the haematoxylin or some other channel. Then the DAB intensity will be more strongly represented in the resulting greyscale image.

And, I suppose, invert the image if you want to look at intensities from a brightfield image.

1 Like

Thank worked great, thank you!

1 Like

As a bit of a follow-up, I’ve run into another issue… when generating a heatmap for my greyscale image (using the ‘Thermal’ LUT), I’m wondering if there is a way to apply a logarithmic scale to the color assignment. I’ve attached a sample image that I would ideally love to be lit-up with red (our positive control), but even after toying around within the Image > Color > Edit LUT… function I can’t seem to achieve a desirable result. I’ve attached I heatmap I obtained from MATLAB as a bit of a guideline as to what I’m hoping for… Thanks!!
70082A_log|690x462
70082A Greyscale.tif (11.0 MB)

Not sure I can help much there. With the basic red lookup table it looks… well, red. But I am not sure about anything more complicated, never had a lot of luck with the Edit LUT either.

Or “Red Hot” maybe?

Probably need to be more explicit about the desired result.

And if you are dedicated to Thermal, you could adjust the brightness/contrast, butI think that type of manipulation is generally frowned on. Though it isn’t really much different than changing the LUT in this case.

I have a 8 bite image

with different intensities and I want to convert to a heat map is it possible and how? I am a newbie in imagej

The previous post was not really a heatmap - just an altered lookup table.

More information can be found there. Pretty much any image channel can be given a different LUT - though this will not initially work well if you have an RGB image.

Heatmaps are usually density based, not so much intensity based, which is where you would use a LUT.

I want to transform pixels intensity to color. Something like this

is that possible or do I have to work with stacks?

Thanks