[ImageJ-devel] Bug? using ConnectedComponents and LabelRegion(s) with ImageJFunctions.wrapByte(ImagePlus imp)

Curtis Rueden ctrueden at wisc.edu
Tue Jun 30 12:34:22 CDT 2015


Hi Jay,

Interesting bug. I did some digging. The two Img<UnsignedByteType>
instances are identical in terms of dimensionality and pixel values, so
that isn't the culprit.

I also tried disabling the labeling computation for SCIFIO to see if it was
an issue of tainted state, but the order of computation doesn't seem to
make a difference either.

I also stepped a bit with the debugger and certainly the issue is inside of
ConnectedComponents.labelAllConnectedComponents. On line 115, the value of
numLabels comes back as 2 for the SCIFIO image and 1 for the IJ1 image.
Digging deeper becomes tricky due to the multithreadedness of the
algorithm, but I fear that's what you'll have to do in order to isolate the
difference in behavior.

Regards,
Curtis

On Tue, Jun 30, 2015 at 1:01 AM, Jay Warrick <warrick at wisc.edu> wrote:

> Hi All,
>
> I am getting different behavior using the new ConnectedComponents class of
> imglib2-algorithm depending on whether I get and Img<UnsignedByteType> from
> a SCIFIO ImageOpener vs. when I get the same image as an
> Img<UnsignedByteType> by wrapping an ImagePlus. In the SCIFIO case,
> ConnectedComponents finds the expected single circle while with a wrapped
> ImagePlus, it doesn't find any regions.
>
> Any thoughts/fixes? Might there be something occurring during the wrapping
> process to cause an issue? Here is a tiny commented maven project with the
> example scenario.
>
> https://github.com/jaywarrick/ConnectedComponentsTest
>
> The tiny .tif I'm using is included in the project but is loaded by a
> string path. Thus, you need to retype the path to the image to match your
> computer, but that should be it. Sorry... wasn't sure how to avoid that
> easily.
>
> Thanks for your help,
>
> Jay
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150630/93eebdeb/attachment.html>


More information about the ImageJ-devel mailing list