[ITK-users] How to add two RGB images?

Alberto Bert bert.alberto at gmail.com
Thu Jan 28 08:07:45 EST 2016


Hi,

I understood why it wasn’t working. It was an overflow problem of the red channel.

Sorry for bothering.

Alb

> On 28 Jan 2016, at 13:13, Alberto Bert <bert.alberto at gmail.com> wrote:
> 
> Hi all,
> 
> I have got an grey level image and a binary segmentation mask extracted from it, and I would like to produce a third image, showing the segmented area in color on top the original grey level image.
> 
> Here is what I am doing:
> 
> image_rgb = sitk.ScalarToRGBColormap(image, colormap = sitk.ScalarToRGBColormapImageFilter.Grey)
> mask_rgb = sitk.ScalarToRGBColormap(mask, colormap = sitk.ScalarToRGBColormapImageFilter.Red)
> mask_overlay = image_rgb + mask_rgb
> 
> Unfortunately, mask_overlay looks just the same as image_rgb, as the addition were not doing any action.
> 
> Any help will be appreciated,
> Thanks,
> 
> Alberto
> 
> PS
> I am using SimpleITK 0.9.1 and Python 2.7
> 
> PPS
> I have already tried the LabelOverlayImageFilter. In fact that was my first choice, but I cannot make it working either (see my previous email, please).



More information about the Insight-users mailing list