Encoding Statistics in Intensity

I tweeted about this yesterday (@cmci_concordia), but I thought I should post it here as well. I wrote a quick macro to encode statistical information of an ROI into intensity. When you run the macro, it expects to be pointed at an image with multiple ROIs that are each a single colour, bordered by at least one 0-value pixel (i.e. to separate touching objects). Once the image is opened, you are asked which statistic you want to encode (e.g. Area, X-Position, Circularity), whether you want to rank the data or encode the actual value of the statistic, and whether you want to scale the data to fill 2^8 colour levels, or the raw value of the statistic.

You can find the macro here: https://github.com/CMCI/colourEncoder

I’m still working on how to deal with holes in objects, how to deal with multiple objects with what should be the same rank position, and how to deal with 3D objects (this is a longer issue, I think). I’m also planning on extending it to include statistics that could be derived from 8 or 16-bit images, not just binary images (you are given the option to encode kurtosis or mean intensity - neither of these is useful in a binary image!)

If you have any other thoughts on what else should be included, please post them here!

Here’s an example of Circularity encoding:
Raw Image:

With Circularity encoded (and LUT applied):

1 Like

For those interested in this kind of functionality, there’s also Shape Descriptor Maps in the #biovoxxel toolbox (by @biovoxxel) :