[Insight-developers] binary object and label definitions in ITK
Miller, James V (GE, Research)
millerjv at crd.ge.com
Tue Feb 28 11:25:23 EST 2006
For binary designation:
Personally, I prefer using "zero" for background and "one" for foreground
for binary objects (as opposed to max()). 'Course, I really don't have
a problem with any nonzero value being identified as foreground.
The only drawback to using "one" for foreground is that when you write
out the image, you may not be able to see the objects because both
the foreground and background are in the low end of dynamic range.
I understand the interest for standardizing this, as I was bit once
when I assumed a filter was producing 0/1 for binary images but was
producing 0/255.
For labels:
The idea of allowing any value to be a valid label is reasonable. In
fact, I think the watershed algorithm makes this assumption. The
relabel component filter currently assumes zero is the background.
A mode could be added to this filter to treat zero as background or not.
This would ensure backward compatibility from a results perspective.
Jim
-----Original Message-----
From: insight-developers-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-developers-bounces+millerjv=crd.ge.com at itk.org]On Behalf
Of Gaetan Lehmann
Sent: Monday, February 27, 2006 4:42 PM
To: insight-developers at itk.org
Subject: [Insight-developers] binary object and label definitions in ITK
Hi,
While talking about types usable to manipulate binary objects and labels with
Zach, we found that they don't seem to be clearly defined in ITK.
For example, ConnectedComponentImageFilter consider that binary objects are
connected set of non-zero pixels, while BinaryDilateImageFilter use a value
setted by the user to manipulate the binary object.
Also, while we can consider as label any value allowed by a type, some filters
may fail if those values are negative.
I think we should clearly define those 2 notions to avoid inconsistency in the
toolkit. I would like to propose the following ones - please correct and
comment them:
- The binary objects are defined with a foreground value, by default
itk::NumericTraits<PixelType>::max(), so we can manipulate several objects
(labels). If a background value is needed, by default we should have always
the same: itk::NumericTraits<PixelType>::NonnegativeMin() (or
itk::NumericTraits<PixelType>::Zero, it just need to be chosen). That's what
BinaryDilateImageFilter does, but it would break
ConnectedComponentImageFilter behavior.
- labels are any values allowed by a type. If a type need to exclude some
values, to define a background for example, the user should be able to set
those values - it would break the RelabelComponentImageFilter behavior.
Comments are welcome !
Gaetan
More information about the Insight-developers
mailing list