Heat Map for multiple segmentations

I have a bunch of lesions here (with organs) but I want the colors of the lesions to be denoted in a manner that if they are overlapping with other lesions it changes color. ie if the two yellow lesions (in the middle of the screen) have a overlap in the middle the color would be say red.

Basically creating a heat map of common points within the lesion. Anyone know of an extension package or a way to take care of this? Any recommendations are appreciated

You can code your segments with prime numbers. That makes them decodeable after they are multiplied. Ot’s a costly iperation but you can have a look up table for it.

Please ask if you have any questions and if you’d be willing tondevelop this for Slicer

There are likely many data structures that would allow you to do this, another one would be to make a volume bitmap. Each bit is for a lesion, and any element in the volume with more than one bit set is an overlap. (If that makes sense.) This could probably be done in python without too much effort.

I agree, this would be a very easy way to find how many structures overlap at each location. You can get each segment as a numpy array and simply add the arrays to get a “heat map”. You can put the result into a volume node and then view it in slice views or volume rendering.

@hherhold @lassoan Thank you both for suggestions! Thank you for the links as well. I will give this a try. Thank you