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

Create a macro-able plugin for applying a warp #42

Open
bogovicj opened this issue Oct 26, 2017 · 10 comments
Open

Create a macro-able plugin for applying a warp #42

bogovicj opened this issue Oct 26, 2017 · 10 comments

Comments

@bogovicj
Copy link
Contributor

No description provided.

bogovicj added a commit that referenced this issue Oct 26, 2017
@imagejan
Copy link

It should be easy to make this an ImageJ2-style plugin (implementing org.scijava.command.Command) that uses @Parameter annotation instead of calling GenericDialog. This would make it callable headless from other applications (such as KNIME), and you'd profit from nice drag-and-droppable file input fields in scijava-common in the future.

bogovicj added a commit that referenced this issue Oct 27, 2017
@bogovicj
Copy link
Contributor Author

Consider modifying the existing (or creating a new script) to optionally accept images that are already open (instead of files).

@imagejan
Copy link

Allowing both opening files or a selection of open images is a common pattern. Maybe this can be supported at a higher level in ImageJ...

@bogovicj
Copy link
Contributor Author

😍

@ctrueden
Copy link
Collaborator

@imagejan Isn't that what your batch processor plugin does? Allow you to run a plugin that normally works on the open image, but across a selection of files?

@imagejan
Copy link

@ctrueden currently it's still restricted on modules with #@ File inputs, my idea was to support any #@ Img (and similar) inputs via the converter framework (i.e. convert File to Img with an option to fail silently on inconvertible, non-image files), or otherwise have a special-cased support for Img, ImgPlus and ImagePlus.

But based on this discussion here, and in addition to the above, I think we should maybe create an new style for the choice widget for #@ Img inputs, something like:

#@ Img (style="from-file-or-open-images") img

This would allow to 1) circumvent the ActiveImagePlusPreprocessor to fill the current image, and 2) show a widget where users can choose to fill the input from either a file, or one of the open images. I imagine a file input field next to a dropdown list with open images (that would get inactive when the file input is filled). I'll open an issue (in imagej-legacy or rather imagej-common?)...

@ctrueden
Copy link
Collaborator

  1. circumvent the ActiveImagePlusPreprocessor to fill the current image

For that, you can already write autoFill = false on the @Parameter annotation.

  1. show a widget where users can choose to fill the input from either a file, or one of the open images.

Why not always allow this option? Is there a case where it would be inappropriate to let someone select a file (or other external source) in addition to the already-open images?

@imagejan
Copy link

There's some related discussion on the forum: Conditional use of script parameters

@imagejan
Copy link

imagejan commented Mar 6, 2020

For the record:

@ctrueden wrote:

For that, you can already write autoFill = false on the @parameter annotation.

This currently doesn't work from scripts (scijava/scijava-common#376), fixed in scijava/scijava-common#377.

@ctrueden
Copy link
Collaborator

ctrueden commented Mar 6, 2020

@imagejan Wow, thanks! Releasing scijava-common version 2.83.0 now.

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

3 participants