MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / showDialog

Method showDialog

ij/src/main/java/ij/plugin/Binner.java:263–288  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

261 }
262
263 private boolean showDialog(ImagePlus imp) {
264 boolean stack = imp.getStackSize()>1;
265 if (imp.isComposite() && imp.getNChannels()==imp.getStackSize())
266 stack = false;
267 GenericDialog gd = new GenericDialog("Image Shrink");
268 gd.addNumericField("X shrink factor:", xshrink, 0);
269 gd.addNumericField("Y shrink factor:", yshrink, 0);
270 if (stack)
271 gd.addNumericField("Z shrink factor:", zshrink, 0);
272 if (method>methods.length)
273 method = 0;
274 gd.addChoice ("Bin Method: ", methods, methods[method]);
275 if (imp.getStackSize()==1) {
276 gd.setInsets(5, 0, 0);
277 gd.addMessage("This command supports Undo", null, Color.darkGray);
278 }
279 gd.showDialog();
280 if (gd.wasCanceled())
281 return false;
282 xshrink = (int)gd.getNextNumber();
283 yshrink = (int)gd.getNextNumber();
284 if (stack)
285 zshrink = (int) gd.getNextNumber();
286 method = gd.getNextChoiceIndex();
287 return true;
288 }
289
290}

Callers 1

runMethod · 0.95

Calls 11

addNumericFieldMethod · 0.95
addChoiceMethod · 0.95
setInsetsMethod · 0.95
addMessageMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextNumberMethod · 0.95
getNextChoiceIndexMethod · 0.95
isCompositeMethod · 0.80
getStackSizeMethod · 0.45
getNChannelsMethod · 0.45

Tested by

no test coverage detected