[ITK-users] Creating a region to store LabelObjects
Pol Monsó Purtí
lluna.nova at gmail.com
Wed Apr 22 06:24:54 EDT 2015
Ah I see,
ShapeLabelMapFilter
<http://www.itk.org/Doxygen/html/classitk_1_1ShapeLabelMapFilter.html> can
be used to set the attributes values of the ShapeLabelObject
<http://www.itk.org/Doxygen/html/classitk_1_1ShapeLabelObject.html> in a
LabelMap <http://www.itk.org/Doxygen/html/classitk_1_1LabelMap.html>.
And an example here:
https://www.orfeo-toolbox.org/SoftwareGuide/SoftwareGuidech20.html
Is it possible to call a method directly with a label object? (I only will
have two labelobjects)
Because otherwise, correct me if I'm wrong, in other to update the
attributes I have to:
get the (shifted!) bounding box of both objects
allocate a labelMap with that region
add the objects to the labelmap
connect it to the input of spaceLabelMapFilter
update.
voilà.
It sounds a bit like an overkill, specially the allocation. Is it
problematic if I set the bounding box manually? I realise all the other
attributes will be wrong until... Does any filter update the attributes or
just ShapeLabelMapFilter?
Thanks for the pointers,
Pol
2015-04-22 10:51 GMT+02:00 Gaetan Lehmann <gaetan.lehmann at gmail.com>:
>
> 2015-04-22 0:22 GMT+02:00 Pol Monsó Purtí <lluna.nova at gmail.com>:
>
>> excellent! thanks.
>>
>> Which method recomputes them?
>>
>
> You can use ShapeLabelMapFilter to recompute the BoundingBox and all the
> attributes of ShapeLabelObject.
>
> Gaëtan
>
>
>>
>> 2015-04-21 20:44 GMT+02:00 Gaetan Lehmann <gaetan.lehmann at gmail.com>:
>>
>>> Hi,
>>>
>>> The attributes are only updated by the filters, not by the label
>>> objects, so you should recompute the attributes after having after moving
>>> them.
>>>
>>> Gaëtan
>>> Le 21 avr. 2015 19:05, "Pol Monsó Purtí" <lluna.nova at gmail.com> a
>>> écrit :
>>>
>>>> After tweaking here and there, I believe the problem was mine that I
>>>> was shifting the objects twice because it doesn't happen anymore.
>>>>
>>>> The Shift problem remains, thought. Shifting doesn't update the
>>>> labelobject attributes, so, right now, I shift the pixels _and_ then shift
>>>> (get,offset,set) the boundingbox, given that those are the attributes that
>>>> I need.
>>>>
>>>> Cheers,
>>>>
>>>> Pol
>>>>
>>>> 2015-04-21 12:29 GMT+02:00 Pol Monsó Purtí <lluna.nova at gmail.com>:
>>>>
>>>>> Hello all,
>>>>>
>>>>> related to a couple of conversations we've had here I've noticed a
>>>>> strange behaviour that is related to the LabelMap representation.
>>>>>
>>>>> I have two label objects
>>>>>
>>>>> bounding box1 ImageRegion (0x7fd381317888)
>>>>>
>>>>> Dimension: 3
>>>>>
>>>>> Index: [23, 40, 2]
>>>>>
>>>>> Size: [60, 71, 9]
>>>>>
>>>>>
>>>>> bounding box2 ImageRegion (0x7fd38131a328)
>>>>>
>>>>> Dimension: 3
>>>>>
>>>>> Index: [74, 18, 2]
>>>>>
>>>>> Size: [24, 39, 9]
>>>>>
>>>>>
>>>>> If I create a region of size [100, 120, 11] it should be able to store
>>>>> those two objects.
>>>>>
>>>>> However, (maybe) that is not the case because the objects are not
>>>>> drawn at slice 2 but on slice 5 when I write the output of
>>>>> LabelMapToLabelImageFilter. There is no exception thrown, thought.
>>>>>
>>>>> I've also noticed that using the Shift function of the LabelObject
>>>>> doesn't change the object's boundingBox, which leds me to think that each
>>>>> pixel has a shift somehow not related to the bounding box.
>>>>>
>>>>> I can provide a Minimum Working Example if needed.
>>>>>
>>>>> I've read the article journal, but I couldn't see the answer, may be
>>>>> related to 'storing the label objects as lines', which I don't completely
>>>>> understand what's the graphical representation of those lines.
>>>>>
>>>>> What is going on?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Pol
>>>>>
>>>>
>>>>
>>>> _____________________________________
>>>> 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/insight-users/attachments/20150422/3f0f4192/attachment.html>
More information about the Insight-users
mailing list