default value for @parameter in Jython scripts

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

default value for @parameter in Jython scripts

Brian Northan
Hi

I saw that Mark recently answered some questions about and updated the documentation for script parameters (http://imagej.net/Script_parameters#Parameter_properties)

This is really helpful.  However I still can't figure out how to set a default value for a parameter in Jython

# @Integer test=10

Just makes the label of the parameter "test=10", I looked at the Parameter notation but couldn't find a property for default value. 

Any suggestions??  I'm probably just missing something simple. 

Thanks

Brian



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: default value for @parameter in Jython scripts

Curtis Rueden
Hi Brian,

> # @Integer test=10
> Just makes the label of the parameter "test=10", I looked at the
> Parameter notation but couldn't find a property for default value.  

Very sorry for how opaque this is. I explained it in a commit message [1].

To summarize, at the moment you have to write:

# @Integer(value = 10) test

The parameter parsing will be rewritten fairly soon, at which point more @Parameter-style features will start working as expected. For details, see scijava/scijava-common#156 [1].

Regards,
Curtis



On Thu, May 7, 2015 at 6:51 AM, Brian Northan <[hidden email]> wrote:
Hi

I saw that Mark recently answered some questions about and updated the documentation for script parameters (http://imagej.net/Script_parameters#Parameter_properties)

This is really helpful.  However I still can't figure out how to set a default value for a parameter in Jython

# @Integer test=10

Just makes the label of the parameter "test=10", I looked at the Parameter notation but couldn't find a property for default value. 

Any suggestions??  I'm probably just missing something simple. 

Thanks

Brian



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: default value for @parameter in Jython scripts

Mark Hiner
>Very sorry for how opaque this is. I explained it in a commit message.


_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: default value for @parameter in Jython scripts

Brian Northan
Thank you guys.  It works perfectly now.

On Thu, May 7, 2015 at 8:51 AM, Mark Hiner <[hidden email]> wrote:
>Very sorry for how opaque this is. I explained it in a commit message.



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel