knip icon indicating copy to clipboard operation
knip copied to clipboard

CCA column preview empty after Image Cropper

Open stelfrich opened this issue 7 years ago • 7 comments

It seems that if Adjust Dimensionality? is unchecked in an Image Cropper node, the output tables of subsequent Connected Component Analysis nodes do not show a preview of the labeling. Clicking on the cell shows the labeling as expected.

Example workflow: CCAPreviewAfterImageCropper.zip

stelfrich avatar Jan 29 '18 07:01 stelfrich

Thank you for reporting this, it seems to be a bug with our preview rendering.

gab1one avatar Jan 29 '18 09:01 gab1one

I noticed the same issue with Adjust Dimensionality? being checked and cropping an XYZ image with a defined Z range: after a Global Thresholder and a Connected Component Analysis, the thumbnails are missing in the output table.

imagejan avatar Feb 07 '18 09:02 imagejan

@stelfrich @imagejan This issue is related to the Image Cropper not renormalizing the axis minima. I created a metanode ZeroMin metanode.zip which performs the needed ZeroMin operation. Just add this as a workaround to your workflows where the cropper behavior causes you issues. We might add this as a popper node to KNIP at a later point in time.

gab1one avatar Feb 08 '18 18:02 gab1one

I noticed that this can also problems when trying to use a legacy ij.ImagePlus as an input parameter in an ImageJ2 plugin.

I got:

ERROR ThreadPool                      An exception occurred while executing a runnable.

... when running my TrackMateSpotDetector on a cropped input image. (Strangely, it still worked when I was running the saved workflow, but threw these errors after I had reconfigured the node...)

Adding your ZeroMin metanode helped here, but I see no way of fixing this inside my own plugin, while still taking an ImagePlus input (and I'd like to avoid the need of a ZeroMin node in the final workflow, ideally).

imagejan avatar Feb 26 '18 14:02 imagejan

You could always run Views.zeroMin(..) on your input images? Something like:

RAI myImp = Views.zeroMin(imp);

gab1one avatar Feb 27 '18 13:02 gab1one

@gab1one yes, of course, if I take an ImgPlus or RAI; but as I take an ImagePlus for using it with TrackMate, I wanted to avoid the additional wrapping, because that's what the framework is supposed to do correctly if I define an @Parameter ImagePlus, no?

imagejan avatar Feb 27 '18 13:02 imagejan

In most cases you will actually get an ImgPlus converted to a ImagePlus, at least in KNIME we always use IJ2 / Imglib2 data structures internally. We do not run Views.zeroMin() on our cropped image segments because then you lose the offset information, which you need if you want to recombine the segments at a later time (e.g. using compose image in the GroupBy node).

Maybe we can add an improved conversion strategy in the future, until then I recommend you just request a ImgPlus / RAI as input, wrap it into an ImagePlus yourself after performing Views.zeroMin(..) on it. Then you have maximal control over it. I am sorry that there is currently no easier way for it.

gab1one avatar Mar 01 '18 10:03 gab1one