[Insight-developers] ITK wrapping status
Michal Suchanek
hramrach at centrum.cz
Fri Oct 22 16:06:36 EDT 2010
2010/10/22 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>
> Le 22 oct. 10 à 19:35, Michal Suchanek a écrit :
>
>> 2010/10/22 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>>>
>>> Le 22 oct. 10 à 17:30, Michal Suchanek a écrit :
>>>
>>>> 2010/10/22 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>>>>>
>>>>>>
>>>>>>
>>>>>> Also the filter intentionally uses UL output to get the best possible
>>>>>> resolution and the image may lose detail when converted to UC.
>>>>>
>>>>> you shouldn't loose anything when converting to UC with the relabel
>>>>> filter
>>>>> if there are less than 256 zones identified.
>>>>> If UC is not enough, there is also US (16bit) available by default.
>>>>>
>>>>>>
>>>>>> The obvious choice of filter for this job it RescaleIntensity but that
>>>>>> is not wrapped with inputs and outputs suitable for this example, nor
>>>>>> is RelabelComponent.
>>>>>
>>>>> RescaleIntensity is NOT well suited for this task, beacause it can
>>>>> merge
>>>>> several labels in a single one. RelabelComponent is the filter you
>>>>> want.
>>>>> RelabelComponent should be wrapped with the necessary types to convert
>>>>> UL
>>>>> pixel type to UC or US.
>>>>
>>>> UC is not wrapped by default so there are no UC filters at all.
>>>>
>>>> US will likely not work with most image writers either but at least
>>>> the modified JPEG should support it.
>>>
>>> UC is always wrapped for the writer, even when not selected in cmake
>>> options.
>>
>> Yes, it is supported by the writer but not by any filters so you
>> cannot convert it to the writer format.
>>
>
> of course you can do the conversion - it would be a complete waste of space
> and build time to have it for the writer without that!
> CastImageFilter is there for that.
CastImageFilter may convert just about anything to anything but unless
it has changed from last time I read the docs it does not ensure such
conversion gives any data at all. Thus an image which has been
previously normalized would produce a black image when casted to
integer type.
More often than not using CastImage is a complete waste of code lines
and processor cycles.
>
>>> US is well supported by tif and png.
>>
>> It is. I get a ~ black output image.
>>
>> While the RelabelComponent filter may be better for preserving
>> information (zones) in the image regardless of intensity (which is
>> artifical on segmentation output anyway) the RescaleIntensity filter
>> is better suited for a demo because it provides the user with
>> segmentation results visible in a plain image viewer (which does not
>> do the equivalent of RescaleIntensity as default preprocessing).
>
>
> You may want to produce a colored output instead of an almost black image
> then.
> LabelToRGBImageFilter is able to convert your label image in a more human
> friendly, colored image.
Yes, that's good update of the example to also show off new features.
It somewhat hides the mechanics of the watersched filter, though.
Thanks
Michal
More information about the Insight-developers
mailing list