[Insight-developers] Re: binary object and label definitions

Richard Beare richard.beare at gmail.com
Thu Mar 16 20:10:29 EST 2006


Hi everyone,

A few thoughts on types for label images:

I'm not sure I'd go with the concept of unsigned types for label
images, or with a new type. However I would agree that filters
producing label images should use positive label values and use zero
to indicate absence. My thinking here is based on the following:

In label propogation algorithms that involve queues it is often
necessary to mark which pixels are on the queue have already been
processed, or the equivalent. Using the negative half of the image
range is often a convenient way of doing this if it is guaranteed to
be available. The alternative is to allocate marker images, which is
obviously possible but more expensive.

Another reason not to insist on unsigned types, or a new type, is the
impact on the size of the libraries used in the interpreter
interfaces. In addition, it is reasonably common to manipulate label
images using masking and other standard image operations, and
introducing a new type is surely going to make this sort of thing even
more complicated, especially for interpreter interfaces.

Now, if an application is never going to do anything radical with a
label image then the unsigned types will be fine, and are likely to be
more efficient. So perhaps the conventions should be:

any integer type (perhaps we should relax this, but I can't see an
obvious reason), zero is "blank", valid labels are positive.

Then rely on the concept checking to deal with signed/unsigned issues
and anything else that crops up for filters that process labels.


More information about the Insight-developers mailing list