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 · 8 comments

Comments

Projects
None yet
3 participants
@bogovicj
Copy link
Contributor

bogovicj commented Oct 26, 2017

No description provided.

bogovicj added a commit that referenced this issue Oct 26, 2017

@imagejan

This comment has been minimized.

Copy link

imagejan commented Oct 27, 2017

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

This comment has been minimized.

Copy link
Contributor Author

bogovicj commented Oct 27, 2017

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

@imagejan

This comment has been minimized.

Copy link

imagejan commented Oct 27, 2017

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

This comment has been minimized.

Copy link
Contributor Author

bogovicj commented Oct 27, 2017

😍

@ctrueden

This comment has been minimized.

Copy link
Collaborator

ctrueden commented Oct 27, 2017

@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

This comment has been minimized.

Copy link

imagejan commented Oct 28, 2017

@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

This comment has been minimized.

Copy link
Collaborator

ctrueden commented Oct 29, 2017

  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

This comment has been minimized.

Copy link

imagejan commented Mar 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment