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

Method run

ij/src/main/java/ij/plugin/Scaler.java:38–72  ·  view source on GitHub ↗
(String arg)

Source from the content-addressed store, hash-verified

36 private int oldDepth;
37
38 public void run(String arg) {
39 imp = IJ.getImage();
40 Roi roi = imp.getRoi();
41 ImageProcessor ip = imp.getProcessor();
42 if (roi!=null && !roi.isArea())
43 ip.resetRoi();
44 if (!showDialog(ip))
45 return;
46 doZScaling = newDepth>0 && newDepth!=oldDepth;
47 if (doZScaling) {
48 newWindow = true;
49 processStack = true;
50 }
51 if ((ip.getWidth()>1 && ip.getHeight()>1) || newWindow)
52 ip.setInterpolationMethod(interpolationMethod);
53 else
54 ip.setInterpolationMethod(ImageProcessor.NONE);
55 ip.setBackgroundValue(bgValue);
56 imp.startTiming();
57 try {
58 if (newWindow && imp.getStackSize()>1 && processStack) {
59 ImagePlus imp2 = createNewStack(imp, ip, newWidth, newHeight, newDepth);
60 if (imp2!=null) {
61 imp2.show();
62 imp2.changes = true;
63 }
64 } else
65 scale(imp);
66 }
67 catch(OutOfMemoryError o) {
68 IJ.outOfMemory("Scale");
69 }
70 IJ.showProgress(1.0);
71 record(imp, newWidth, newHeight, newDepth, interpolationMethod);
72 }
73
74 /** Returns a scaled copy of this image or ROI, where the
75 'options' string can contain 'none', 'bilinear'. 'bicubic',

Callers

nothing calls this directly

Calls 15

getImageMethod · 0.95
isAreaMethod · 0.95
resetRoiMethod · 0.95
showDialogMethod · 0.95
getWidthMethod · 0.95
getHeightMethod · 0.95
setBackgroundValueMethod · 0.95
createNewStackMethod · 0.95
showMethod · 0.95
scaleMethod · 0.95
outOfMemoryMethod · 0.95

Tested by

no test coverage detected