Hi, I am lost in color-space. Maybe someone can point me in the right direction. I want to generate ratiometric (Yellow/Cyan) images that resemble the image below, a HSL image where the hue illustrates the ratio and the fluorescence level the intensity (saturation is set to 100% in this example, which is generated in Igor Pro, btw). And if anyone knows if anyone made a similar calibration cube for ImageJ (color top-bottom, intensity left-right), that would be great! If anyone wants to play with this you can use the example images at the bottom of this post.
please do not use JPG to store/share your image data, since it uses lossy compression and is hence not suited for analysis. Could you upload the raw image data instead?
You could try the following:
open both images via Plugins > Bio-Formats > Bio-Formats Importer. Take care to open the original raw data that you got from the microscope. If both channels are stored in the same image you can tick “split channels” in the Bio-Formats Importer.
use process -> image calculator to create the ratiometric image by dividing yellow/cyan
then you can change the LUT (lookup table) for better visualization via Image -> lookup Tables -> Rainbow RGB (for example)
you can add a scale bar via Analyze > Tools > Scale Bar
you can also add a scale bar for the intensity using Analyze > Tools > Calibration Bar
Hi Kai, thanks for your reply. I don’t use JPG to store or share my data I drag/dropped .png files (500 kB) from file explorer in ubuntu to this forum on chrome, for some reason it converted to .jpg, is this working as intended @imagejan? I will update my post. EDIT: Even using the Upload button in the forum GUI they convert .png to .jpeg, weird. I included an imgur link in stead. Not that it really matters for this post.
@CellKai, I know how to split channels and make ratiometric images, thats what I’m already doing, maybe that wasn’t clear. I wan’t an output where the color indicates the ratio and the intensity the fluorescence of the FRET-pair fluorescent proteins.
Yes, I know, but my question was is there a combined scale bar, and a scale bar that indicates both intensity and ratio, please see the screenshot in my post.
Thanks for the heads up, @Sverre.
I did some quick search and found that in newer version of Discourse (the forum backend), “large” images are auto-converted to .jpg:
This might be useful for forums where users upload a lot of stuff from mobile devices (e.g. raw captured photographs), but for the ImageJ forum, compression might not be desired as you guys pointed out (and I wouldn’t consider any of you as “Bad Users” ;-)).
I therefore looked for this option in the settings and disabled compression by setting quality to 100:
@Sverre I would still prefer having the files embedded in the forum instead of linking to an external site (and after my changes, it should work as intended). Do you want to try yourself by editing your post once more?
You should be able to generate the image using the image calculator and filling the Hue and Brightness of an HSB Stack accordingly, right?
I don’t know if anyone did this already, but I think it should be straightforward by generating a small image, filling it with gradients (vertical hue, horizontal brightness), and using this as an overlay on your RGB image generated from the raw data.
I edited and can confirm that both drag/drop and gui facilitated upload no longer converts to jpg, thanks
So this is what I tried, but it left me more confused. I was hoping to get an output where the hue channel was the ratio (0 to ~2…) and the brightness channel the… brightness (of either the yellow or cyan channel, probably cyan). I tried the following and got strange results, which I suspect seem strange because I don’t understand them, maybe it makes sense to you!
Image calc. Divide yellow/cyan (32-bit float) -> Ratiometric image
Merge channels: Ch 1 = Ratiometric image, Ch 2 = Cyan raw. (Tried both composite and… not composite)
Type >> RGB to HSB
Image >> Color >> Stack to RGB
However, the values in the Hue and Brightness channels of this HSB stack do not seem to correspond at all to the original ratiometric values, or the brightness values from the cyan channel. Any thoughts?
I wasn’t able to find it. Before i delve into this, would I need to develop an ad hoc java plugin, or could this be scripted efficiently (I’m a python guy)? I supose I could just use the same small image and then add the appropriate text in a scripted action.
You first merge the channels and then change the color space to HSB. Instead, you should first create an empty HSB stack, then paste your image data into the appropriate slices, and finally convert back to RGB.
ImageJ (at least the ImageJ 1.x commands we’re using here) handles both RGB and HSB images with 8 bit per channel only. If you have a ratiometric image as 32-bit float, you’ll have to scale it correctly to 8-bit (e.g. set min and max from 0.0 to 2.0, then change to 8-bit) before transferring it to the HSB stack.
Here’s a macro that illustrates how to create a 2D gradient image with horizontal brightness and vertical hue gradient:
// Create gradient image
newImage("Gradient", "8-bit ramp", 256, 256, 1);
// Create empty result image
newImage("Result", "RGB black", 256, 256, 1);
// Paste left-right gradient into B channel
// Rotate and scale gradient
run("Rotate 90 Degrees Right");
// Paste top-bottom scaled gradient into H channel
// Set saturation (S) channel to all white
setForegroundColor(255, 255, 255);
// Convert HSB to RGB
(I scaled the Hue gradient by 0.66 to approximately match your example image’s hue from red to blue, without taking the full turn back to red.)