knime-ip / knip

KNIME Image Processing Extension
https://www.knime.com/community/image-processing
49 stars 11 forks source link

Enlarge Segments #442

Closed tibuch closed 7 years ago

tibuch commented 7 years ago

Enlarge Segments takes every segment of a Labeling and enlarges it by a given number of pixels.

This is different from labeling resizing. If we enlarge a segment, the distance from the new segment border to the old segment border is always the given number of pixels.

image

I have created a Wrapped Metanode (enlarge_labels.zip) (with a Java Snippet Node inside) which generates such a Labeling.

dietzc commented 7 years ago

Oh, wow. Great job building this workflow. However, the top-part seems to be a bit messy? Can't you put the entire top-part of the workflow (dimension extraction etc) inside the java-snippet? Potentially, you could even do the ROI extraction in the java snippet, i.e. iterate over each label and do it...?

imagejan commented 7 years ago

Thanks for the illustrative Java Snippet example!

I know the issue is about creating a new node, but I have some questions/comments anyways regarding the example Metanode:

(By the way, trying to open the contents of the metanode on my MacBook reliably freezes my KNIME instance, while there are no problems opening it on Windows. Any ideas?)

tibuch commented 7 years ago

@imagejan Morphological Labeling Operations works like a charm with a disk-shaped structuring element. I just forgot the option which allows a custom structuring element. Thanks for pointing it out!

Here is the new version: growing_labels.zip

Is there a simpler way to create a disk of a certain size? Only way I know is Java Snippet.

imagejan commented 7 years ago

Is there a simpler way to create a disk of a certain size?

There is the Structuring Element Creator that lets you create spheres and boxes of arbitrary size, in any number of dimensions :-)


Fun fact (or bug report?): when opening your workflow, executing the Interactive Segmentation View, then looking at the Outport of the Image Generator -> it contains a white circle, whereas it should be all black! (tested on Windows) Can you reproduce? Is this due to your use of the Java Snippet? It also happens when I execute the Java Snippet without previously executing the Generator, but not when executing the Generator explicitly...

tibuch commented 7 years ago

Oh right! :blush: Thanks again @imagejan


I can reproduce this. I guess it is due to the fact that I write directly to the input image in my java-snippet. Which is not best practice.