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

Neal R. Harvey harve at lanl.gov
Thu May 13 14:48:32 EDT 2010


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?
>
>
>
>



More information about the Insight-users mailing list