Using choice widget in Fiji/IJ2 scripts

Hi guys,

The @parameter annotations is a great feature when preparing tools for non programmers
I wanted to use the choice widget in Fiji/IJ2 scripts for some time but realized the feature was not yet functionnal 1.

I discussed the topic with @hkmoon and he actually implemented an improved parsing of the attributes, handling choices parsing 2.

This being said, Would that make sense to submit a pull request for it? And what would be the typical guidelines (i.e. am not sure what should be the cannonical ressource. here 3 maybe? )

Just for illustration, in Fiji using java 8, it makes possible to use choices Fiji script (here in IJ1 macro)

//@String (label = "radio buttons (horizontal)",style = "radioButtonHorizontal", choices = { "Yes","No", "Maybe" }) choiceRadioH
//@String (label = "radio buttons (vertical)",style="radioButtonVertical", choices = { "Loved", "Liked", "Ok","Disliked" }) choiceRadioV
//@String (label = "choice list",style="listBox", choices = { "The", "quick", "brown","fox", "jumps", "over", "the", "lazy", "dog" }) choiceListBox

and get this kind of ui to harvest the data

Thanks for your help,

I am in the process today of implementing that feature using the SciJava expression parser (SJEP).

A pull request with that feature months ago would probably have gotten merged, but we now have a more robust way using SJEP. I was hoping to complete this work today, and make it available to users by the end of the week. I’ll keep you posted.

Thanks for the quick feedback. It’s good to see that the feature are coming through, one way or another.
In any case, we’ll be happy to do more of such contributions in the future, hopefully with a better timing :wink:

Pull request filed: scijava/scijava-common#237

It will likely be merged, released and uploaded tomorrow!

Awsome! I am looking forward to try it.

New feature seems to resolve the comma problem as well.
It looks great.