[ITK] pixeltype define and template lost in python warped ITK

gowith king gowithking at googlemail.com
Tue Sep 16 04:27:49 EDT 2014


Hi , Matt
     I tried it , it does not work as well. the print
LabelFilter0.GetNumberOfObjects() always returns 0,
    what i want to do it every nasty: sign 1 to label 1, 100 to label 2
,and there is no background at all.
   My images all like the attached image but in 3D , the 3D version will be
attached later ,thank you for your attention

On Mon, Sep 15, 2014 at 11:58 PM, Matt McCormick <matt.mccormick at kitware.com
> wrote:

>
>
> On Mon, Sep 15, 2014 at 5:31 PM, gowith king <gowithking at googlemail.com>
> wrote:
>
>> Thanks McCormick , I use the dir(itk,Image) and dir(itk.LabelMap) and
>> dir(to get some information : UC3 is included in itk.image then it is good.
>> Then I tried all the other dir() for each of my filter , made lots of
>> correction , now the pepline works perfect [?] Thank you again .
>>
>> But I still could not get my result ...
>> because of the filters I may not really understand.
>>
>> I have three filters
>> BinaryThresholdImageFilter # to get a binary image for now I get only two
>> values 1 and 100 it works well. I what the labelmap contains both two parts
>> of them
>> BinaryImageToLabelMapFilter #I have no idea if it works well or not
>> LabelMapToLabelImageFilter   # returns a empty image
>>
>> Do you have any idea about this ?
>>
>
> Perhaps SetInputForegroundValue [1] needs to be set?
>
> HTH,
> Matt
>
> [1]
> http://www.itk.org/Doxygen/html/classitk_1_1BinaryImageToLabelMapFilter.html#a5c56958ec0ae8d3a9bf7ae759c680c4a
>
>
>
>>
>> On Mon, Sep 15, 2014 at 10:12 PM, Matt McCormick <
>> matt.mccormick at kitware.com> wrote:
>>
>>> Hi gowith,
>>>
>>> To see the available types for itk.Image, run
>>>
>>>   dir(itk.Image)
>>>
>>> If a type is not available that is desired, enable the option in CMake
>>> for that pixel type.  For unsigned short, set
>>>
>>>   ITK_WRAP_unsigned_short
>>>
>>> to ON.
>>>
>>> Hope this helps,
>>> Matt
>>>
>>> On Mon, Sep 15, 2014 at 2:19 PM, gowith king <gowithking at googlemail.com>
>>> wrote:
>>>
>>>> Hi McCormick
>>>>      I think you give me a hint for the key error problem: I tried few
>>>> other types in my python such as US , UI, SI ... most of them could not
>>>> work well . another keyerror pops out for the template lose: when I try
>>>> itk.Image[itk.SI, 3]
>>>> KeyError: 'itkTemplate : No template (<itkCType signed int>, 3) for the
>>>> itk::Image class'
>>>>
>>>>
>>>>
>>>> On Mon, Sep 15, 2014 at 8:11 PM, gowith king <gowithking at googlemail.com
>>>> > wrote:
>>>>
>>>>> Hi McCormick
>>>>>      Thank you so much for your suggestion, when I use US it pops out
>>>>> a keyerror , not template for the us3 [?]. But then I change to SS it
>>>>> works well for now.
>>>>>      any suggestion for the second issue ?
>>>>>      I dig for really long time for this keyerror problem , but have
>>>>> no clue at all
>>>>>
>>>>>
>>>>> On Mon, Sep 15, 2014 at 7:54 PM, Matt McCormick <
>>>>> matt.mccormick at kitware.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>    -      The imagetype of itk.Image.UC3 should be used for 16 bit
>>>>>>>    image in all the itk instructions. But in my case it only has a range of
>>>>>>>    0-255. Then I take itk.Image.F3, then it get a range of
>>>>>>>    '-3.40282346639e+38  3.40282346639e+38' . The grey value of my image is
>>>>>>>    0-9000 . How could I read it proprietorially?
>>>>>>>
>>>>>>> itk.Image.UC3 is an itk::Image with unsigned char pixels (range
>>>>>> 0-255) and with three dimension.  For the correspondence between mangled
>>>>>> names and basic types see [1].  For a 16 bit image use 'US' or 'SS'.
>>>>>>
>>>>>> HTH,
>>>>>> Matt
>>>>>>
>>>>>> [1]
>>>>>> http://itk.org/gitweb?p=ITK.git;a=blob;f=Wrapping/WrapBasicTypes.cmake;h=f303a1c245a541e702674f969dac8209b12f2e93;hb=HEAD
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140916/25dacd99/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Selection_001.png
Type: image/png
Size: 23881 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140916/25dacd99/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 33A.gif
Type: image/gif
Size: 581 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140916/25dacd99/attachment-0004.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 330.gif
Type: image/gif
Size: 96 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140916/25dacd99/attachment-0005.gif>


More information about the Community mailing list