[Insight-users] LabelGeometryImageFilter - erroneous information for objects at image boundaries

Luis Ibanez luis.ibanez at kitware.com
Tue May 25 12:03:40 EDT 2010


Hi Neal,

Thanks for pointing this out.

This actually looks like a bug...


Is there a chance that you could share with
us any simple image containing one of this
1-pixel-wide objects ?

(a small image will be greatly appreciated).

We could then use such image in order to log
a bug entry, and track the problem.


     Thanks


         Luis


----------------------------------------------------------
On Thu, May 13, 2010 at 2:48 PM, Neal R. Harvey <harve at lanl.gov> wrote:
> After doing a little more research, it turns out it has nothing to do with
> being at the image boundary.
> It appears to be a problem if you have an object that is 1 pixel thick in
> the x or y directions, so that the
> bounding box has identical co-ordinates for one (or both, probably) its
> axes.
> The test image I was using had these thin objects at the boundary. Hence, I
> thought it was a boundary problem.
> Given that I will inevitably run into occurrences where I have such thin
> objects, I can't use the
> LabelGeometryImageFilter, and have had to resort to coding a DIY centroid
> and bounding-box calculator
> (which really isn't that hard). Other people who are using this filter
> should also bear this in mind.
> Has anyone else experienced problems similar to this?
>
> Neal R. Harvey wrote:
>>
>> I have been getting some very strange results with the
>> LabelGeometryImageFilter when it is calculating
>> the characteristics of objects that are located on the boundaries of
>> images. It seems to work fine for objects
>> that are away from the boundary.
>>
>> For example, in one of the images I am examining there are several small
>> objects on the boundary. I can
>> write out the labeled image and examine it using software such as IDLand
>> Matlab and can see where the
>> labeled objects are. However, the LabelGeometryImageFilter gives the
>> centroids and bounding boxes of
>> the objects as lying somewhere out in the main part of the image.
>>
>> Specifically, I have a 1000x1000 image, that has been thresholded
>> (BinaryThresholdImageFilter) and then a
>> connected component analysis (ConnectedComponentImageFilter) performed on
>> the thresholded result,
>> followed by a relabeling (RelabelComponentImageFilter)
>>
>> In the resulting labeled image, there is a blob, of area 29 pixels, that
>> has its centroid at approximately [998,494],
>> so the blob is butting right up against the edge.
>>
>> The LabelGeometryImageFilter returns the following, with respect to its
>> centroid position: [679.033, 415.933]
>> and its bounding box size [622, 158].
>>
>> Now, if I look in that region of the image, there is nothing.
>>
>> Anyone else had any problems like this? If so, how did you solve it? Am I
>> going to have to embed all my images
>> in a slightly large image, to ensure that all of my labeled blobs are
>> never at the edge?
>>
>>
>>
>>
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list