Open
Description
I had to change the type of the field from
double
toDouble
, otherwise thegetInfo().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(); }