Closed dietzc closed 9 years ago
@dietzc You can use ImgLabeling.getMapping().numSets()
to get an upper bound. This will give you the number of all label combinations (that is what you are after when you decide on the IntegerType
, right? Not the number of labels.) that ever occurred at any pixel. The actual number may be less because certain label combinations might no longer present. For example, if you have a 1 pixel image and you add labels A, B, C to the pixel, your labeling has seen label sets {}, {A}, {A,B}, {A,B,C}. Still I think it is reasonable to use this as an estimate. If you need the exact number, you need to iterate.
@dietzc Can this be closed?
Yes! Thanks!
use-case: we want to create a new
ImgLabeling<V,?>
with the same dimensionality and amount of labels asRandomAccessibleInterval<LabelingType<V>>
. However, Istill have to decide on theIntegerType
of theImg<IntegerType>
. Is there an efficient way to get the number of labels which are contained on theRandomAccessibleInterval<LabelingType>
without iterating over it (given that the RAI may be aView
)? Or do I have to iterate over theRandomAccessibleInterval<LabelingType>
?