[ImageJ-devel] Overriding min, max and choices at runtime

Lee Kamentsky leek at broadinstitute.org
Mon Jun 20 15:15:40 CDT 2011


I have a more-general mechanism in CellProfiler that lets you do this 
kind of thing. The module (read ImageJ plugin) has a method that returns 
a collection of settings. These are equivalent to the parameters in 
ImageJ 2.0. You can restructure the collection contextually in response 
to user events - for instance, there's a "DoSomething" setting which is 
displayed as a button and it calls a callback when the button is 
pressed. You can implement an "Add another" button that changes the 
module's setting list in the callback and the framework will ask for the 
settings again, with the settings added by pressing the button.

CellProfiler 1.0 had a fixed list and it felt like it was arbitrarily 
limiting - you'd run into cases where you wanted four of something, but 
provisions were there for only 3 slots.

IMHO, unfortunately pretty far down the line to change the way this 
works, but you could convince me otherwise.

-- Lee

On 6/20/2011 4:06 PM, Barry DeZonia wrote:
> I have created a ticket to track this issue: 
> http://dev.imagejdev.org/trac/imagej/ticket/623. Note that it does not 
> yet include anything from this discussion.
>
> In regards to the proposal note that I see that the issue is more than 
> just allowing us to populate choices and min/max at runtime. In the 
> ReorderAxes plugin I'd like to have 3 parameters each of which has 3 
> choices for an XYZ Dataset. And 5 parameters each with 5 choices for 
> an XYCZT Dataset. So I should be able to specify the number of 
> parameters at runtime also. Or make the plugin have the max possible 
> but only enable and display/use a subset of the parameters present.
>
> On Mon, Jun 20, 2011 at 2:43 PM, Curtis Rueden <ctrueden at wisc.edu 
> <mailto:ctrueden at wisc.edu>> wrote:
>
>     Hi Grant, Barry et. al,
>
>     At the meeting today we discussed how there is currently no way to
>     override an annotated parameter's min, max or choices settings. It
>     would be nice to be able to set them based on the current state
>     upon plugin execution.
>
>     One way is to have option callback methods for min, max and
>     choices. So rather than a constant value, the min, max and choices
>     are computed by a method dynamically. For min and max, there could
>     be a notation like putting "#" in front of the string to indicate
>     it's a callback, since min and max of Parameter are already
>     strings. For choices, it's a String, so you'd have to write it as:
>     'choices = {"#nameOfCallback"}'.
>
>     Do you think that's too awkward? Anyone have any better ideas?
>
>     -Curtis
>
>
>     _______________________________________________
>     ImageJ-devel mailing list
>     ImageJ-devel at imagejdev.org <mailto:ImageJ-devel at imagejdev.org>
>     http://imagejdev.org/mailman/listinfo/imagej-devel
>
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagejdev.org
> http://imagejdev.org/mailman/listinfo/imagej-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110620/bfd13c08/attachment.html>


More information about the ImageJ-devel mailing list