Skip to content

Add #@callback and #@initialize directives #200

@imagejan

Description

@imagejan

Adding simple callbacks for interdependent parameters should be possible from within scripts, e.g. in Python:

# @ImagePlus imp
# @int (label="Width", callback="widthChanged") width
# @int (label="Height", callback="heightChanged") height

def widthChanged():
  height = imp.getHeight() * width / imp.getWidth()

def heightChanged():
  width = imp.getWidth() * height / imp.getHeight()

The difficulty about this is that currently the script is parsed only after the parameters were harvested, so that the callback functions are not available at the time of parameter harvesting.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions