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

Allow optional prediction mask for pixel classification #7

Open
imagejan opened this issue Apr 13, 2018 · 3 comments · May be fixed by #65
Open

Allow optional prediction mask for pixel classification #7

imagejan opened this issue Apr 13, 2018 · 3 comments · May be fixed by #65
Assignees
Labels

Comments

@imagejan
Copy link
Contributor

I suggest adding an optional input to the Run Pixel Classification Prediction node, allowing to choose an image column that contains a prediction mask.

See knime-ip/knip-ilastik#17 for the previous issue opened on knip-ilastik.

@k-dominik
Copy link
Contributor

Question: is it possible to have "optional" arguments in plugins? :)

@Tomaz-Vieira Tomaz-Vieira self-assigned this Jul 28, 2020
@imagejan
Copy link
Contributor Author

@k-dominik yes:

@Parameter(required = false)
private Img maskImage;

You'll have to check for null yourself though. And while I would expect this to work in KNIME, I am not sure how this will be handled in the SciJava Swing UI, as it probably will show a drop-down, but this won't contain a None option. Might be something to improve over there in scijava-common and scijava-ui-swing ...

@Tomaz-Vieira
Copy link

Tomaz-Vieira commented Jul 30, 2020

I've submitted a draft PR implementing this, and it works fine. Still, I could not find any way to add an optional parameter to the Command.

The problem is that the old macro calls should still work, and to achieve that, the command must have a default value for the new parameter. The only way I found that would actually make the command run without the extra parameter is by setting the new input to "resolved" (which apparently means that it already has a value and is ready to be used). Doing that, though, makes the input not show up in the UI in interactive mode.

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

Successfully merging a pull request may close this issue.

3 participants