[ITK] [ITK-users] LabelOverlayImageFilter with a binary mask: everything red

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jan 28 09:13:40 EST 2016


Hello,

There two potential issues here you need to isolate. The first: Is the filter behaving the way you expect? And the second: Is the image being written correctly? also related is: Does the view support the file type you created?

Start by inspecting the pixel values of output image.

Also keep in mind that many gray scale viewers apply window and leveling, while RGB viewers don’t. So you may need to scale the intensity of you gray scale image before apply the LabelOverlay filter.

HTH,
Brad

> On Jan 28, 2016, at 6:51 AM, Alberto Bert <bert.alberto at gmail.com> wrote:
> 
> Hi,
> 
> a few updates...
> 
> Instead of using .nii, I tried to save the output overlay image in:
>  .png  - the resulting image is in grey levels, but I cannot see any red (or other colors)
> .dcm - the resulting image looks corrupted both opened with imagej and Osirix
> 
> Any ideas?
> 
> Thanks
> Alberto
> 
>> On 28 Jan 2016, at 11:30, Alberto Bert <bert.alberto at gmail.com <mailto:bert.alberto at gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> I am trying to produce a coloured overlay between a UInt16 grey-level image and a segmentation mask extracted from such image. The segmentation mask is a UInt8 image valued 1 in the segmented area and 0 elsewhere.
>> 
>> If I try to:
>> 
>>  mask_overlay = sitk.LabelOverlay(image, mask, opacity = 0, backgroundValue = 0)   # I am using SimpleITK 0.9.1 with Python 2.7
>> 
>> and then I write the mask_overlay (as .nii), I get an image almost completely reddish, while I expected to get the original grey-level image, with some red (or other color) corresponding only to the pixels valued 1 in the mask. (I did check the mask itself, and very few pixels are valued 1)
>> 
>> What am I doing (or expecting) wrong?
>> 
>> Thank you in advance,
>> Best
>> Alberto
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160128/a2e06c12/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list