Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicCommand does not fully work with primitive parameter types #429

Open
ctrueden opened this issue Dec 4, 2021 · 1 comment
Open
Labels
Milestone

Comments

@ctrueden
Copy link
Member

ctrueden commented Dec 4, 2021

@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();
    }
@ctrueden ctrueden added this to the unscheduled milestone Dec 4, 2021
@ctrueden ctrueden added the bug label Dec 4, 2021
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/change-scijava-parameter-label-at-runtime/60574/6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants