Skip to content

DynamicCommand does not fully work with primitive parameter types #429

Open
@ctrueden

Description

@ctrueden

@tischi wrote:

I had to change the type of the field from double to Double, otherwise the getInfo().getMutableInput(...) was not working for me.

I put here the full code for future reference:

@Plugin(type = BdvPlaygroundActionCommand.class, menuPath = ScijavaBdvDefaults.RootMenu+"BDV>BDV - Screenshot",
        description = "Creates a screenshot of the current BDV view. The sampling can be chosen to upscale or downscale" +
                " the image compared to the current view. A single RGB image resulting from the projection" +
                " of all sources is displayed. Raw image data can also be exported as multi-channel grayscale.")
public class ScreenShotMakerCommand extends DynamicCommand implements BdvPlaygroundActionCommand, Initializable
{

    @Parameter
    public BdvHandle bdvh;

    @Parameter(label="Target Sampling [UNIT]")
    public Double targetSamplingInXY = 1D;

    @Parameter(label="Show Raw Data")
    public boolean showRawData = false;

    private String pixelUnit = "Pixels";

    @Override
    public void run() {
        ScreenShotMaker screenShotMaker = new ScreenShotMaker( bdvh );
        screenShotMaker.setPhysicalPixelSpacingInXY( targetSamplingInXY, pixelUnit );
        screenShotMaker.getRgbScreenShot().show();
        if( showRawData ) screenShotMaker.getRawScreenShot().show();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions