Here’s my minimal example:
It’s not a real use case, but I think it’s ok to get the idea.
Suppose I have a class ImageDisplaySettings, which encapsulates some settings I’d like to apply on any image:
Now I’d like to have:
Command which creates the
ImageDisplaySettings object. Let’s call it CreateDisplaySettingsPutAsItemOutput. The important part is that I annotate
ImageDisplaySettings ids as an
ItemIO.OUTPUTobject in it.
- and a
Command which applies these settings to an Image, called
ApplyDisplaySettings. It takes an ImagePlus as an input as well as a
This pair of Command do not work together when using Fiji (at least with the FIJI user interface). See this screencast:
The first command
CreateDisplaySettingsPutAsItemOutput can be launched but the output is ignored, and a warning message is shown. Thus, when I start the
ApplyDisplaySettings Command no argument is found for the input parameter
If I replace the first Command by another Command
CreateDisplaySettingsPutInObjectService, which puts the newly created object into an
ImageDisplaySettings ids = new ImageDisplaySettings();
Then both Commands can work together (see end of screencast): I can execute the first one, and thanks to the object service, the
ImageDisplaySettings is passed to the
ApplyDisplaySettings Command via the
However I feel that using the
ObjectService in the second command is a bit painful. The first command using
ItemIO.OUTPUT looks nicer. But how to avoid ignoring the output Object ?
What’s the (proper) solution ?
- Implementing a
DisplayPostprocessor for these new classes ? (I need to look at it)
- Couldn’t all ignored output objects be send to a default
Thanks for reading all this!
Link to the full repo: