Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dimension input error with Get Polygon Points from 2D Binary Mask node #16

Open
Fritze opened this issue Jun 10, 2021 · 2 comments
Open

Comments

@Fritze
Copy link

Fritze commented Jun 10, 2021

Hi Jan,

I finally had time to integrate your great Get Polygon Points from 2D Binary Mask node into my KNIME workflows. It works great!

However, when using the node on bitmasks of labelings that were produced by the trackmate tracker node, I came across the following error :

WARN  Get Polygon Points from 2D Binary Mask 0:671      Error while executing row: 020.png_020.png#track_0! Cause: No matching 'net.imagej.ops.Ops$Geometric$Contour' op

Request:
-    net.imagej.ops.Ops$Geometric$Contour(
        ArrayImg,
        Boolean)

Candidates:
1.     (Polygon2D out) =
    net.imagej.ops.geom.geom2d.DefaultContour(
        RandomAccessibleInterval in,
        boolean useJacobs)
    Inputs do not conform to op rules
        in = ArrayImg [156x119x132]
        useJacobs = true

I suspect the problem might be that my input is "three-dimensional" since the bitmasks also contain the time dimension (132 in this case) after tracking.
Maybe this is what is causing the error? Would there we a way of ignoring the 3rd dimension (if it is time) maybe?
Best and thanks a lot,
Friedrich

@Fritze Fritze changed the title dimension error with dimension input error with Get Polygon Points from 2D Binary Mask node Jun 10, 2021
@imagejan
Copy link
Member

Hi @Fritze, and sorry for the delayed reply!

Indeed, the contour implementation in imagej-ops only supports 2D polygons. We should probably emit a more informative warning in this case.

What do you mean by "ignoring" the 3rd dimension, would you like the node to only process the first slice in this case? If you have one polygon per frame, I'd suggest using the Splitter node (maybe followed by Unpivoting) and then get the polygon points for every row.

I'm also open for other suggestions how this node should be improved.

@Fritze
Copy link
Author

Fritze commented Jun 30, 2021

Hi @imagejan,

Thanks for the reply. You are right, I was a bit confused by the error message but it makes sense that the node takes only 2D bitmasks without the time dimension. A specific warning would probably help.

I now use the Feature Calculator node after the Trackmate Tracker to get a bitmask for each frame. Then I can use Get Polygon points from 2D Binary Mask and everything works like a charm.
Sorry for the confusion and thanks a lot again for developing this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants