(String arg)
| 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', |
nothing calls this directly
no test coverage detected