Cluster analysis and heatmap of ROI

Hi, I need to make a heatmap of only one ROI in an image. Lookup table (LUT) gives the colormap to the whole image and not only to the specific ROI. How can I limit the colormap only to ROIs?
In addition, I want to perform cluster analysis on my images. In order to produce a heatmap based on my defined bin sizes, I need to enter the bin size values in ImageJ and produce a colormap of the ROI based on the pixel values. I don’t know where to put the bin values for each cluster in ImageJ.

Hi @Negah,

The first part of your question could be solved manually as follows:

  1. make a duplicate of your image
  2. convert one copy in an RGB image
  3. apply the LUT you liek to the other copy and select the area you are interested in
  4. copy the selected area
  5. restore the selection in the RGB image [Shift]+[E]
  6. paste the copied part in the RGB image, this should show the LUT only in the selected region.

A small macro will surely make this faster in handling.

Second part of your question…(potential partial answer)
I am not sure which pixel values you want to analyse by cluster analysis but assuming that it is the average/mean intensity value in each of your selected can collect your ROIs in the ROI Manager and run its measure command. In the results table you can go to Results and distribution. There you can select e.g. the mean intensity value and specify the bin size. For a further analysis the List button gives you the oportunity to transfer the binned results to other programs.


Thank you for your response. How can I put the bin values in the calibration bar of the selected LUT instead of the automated bin sizes that ImageJ produces? for example to say that I want to give dark blue color to values between 0-10, light blue to values between 10-20, dark green to 20-30, light green to 30-40, yellow to 40-50, orange to 50-60, red to 60-70 and dark red to values above 70.

Hi @Negah,

you can create your own LUT (Image►Color►Edit LUT…) and thereafter add a calibration bar (and if necessary copy that between images, because it will not work in RGB images:

that’s the normal 16 colors LUT from IJcopied into the RGB image after creating it in the 8-bit image with the corresponding LUT applied.

1 Like