Thickness color scale bar

Hello everyone,

I want to show my 3D image by the Thickness result with color. How to draw the color scale bar? Like this:

I know the color scale can be seen in the histogram of thickness images.

Can this scale bar be added in ImageJ? Or need to use other software to do this?But how to determine the value along the color gradient?

Any leads will be appreciate!



Can this help?
Binary—> Distance Map---->Analyze—>Tool—> Calibration Bar

Hi @Mathew
Thanks for your reply!
Yes, What I want is the resulting chart shown in your link!!!

But I’m a stranger to macro…I tried, but I didn’t get the same result chart as you. And I got a warning message that Unrecognized command: “RGB to CMYK” in line 21
And my sample is a stack. By the way, there is something I need to change according to my sample in the macro you offer?

What’s the Distance Map is? Have to produce a distance map to draw a color bar? How to do it in general?Is this flowwork based on slice or stack?

This is my sample for your better understandthickness.rar (13.7 MB)

Sorry, I have no idea about this at all, so the questions are a little messy. Thank you so much for your patience :sob:.

It’s my fault


Replace Skale Bar with Calibration Bar

newImage("Untitled", "RGB white", 512, 512, 1);
roiManager("Select", 0);
roiManager("Set Fill Color", "black");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Distance Map");
run("16 Colors");
run("Calibration Bar...", "location=[Upper Right] fill=White label=Black number=5 decimal=0 font=12 zoom=1 overlay");

really sorry: it’s morning for us! Not awake …

Thanks, @Mathew,
Inspired by you, I found that based on the thickness slices just choose Analyse/Tools/Calibration Bar, then the color bar will appear in the window.

However, in 3D viewer, it seems that the color bar cannot be generated in this way. But it doesn’t matter. If there is no other method in ImageJ I can use other software to combinate the 3D image and color bar.

I also run your code for my sample. It works!And the output image is identical to your upload. But the value in the color bar is strange…Because the max thickness in my sample is 43, why the max value of the color bar produced by the code is 98?

Thank you very much for answering my question in the early morning. Have a nice day!