(ImageProcessor ip)
| 31 | } |
| 32 | |
| 33 | public void run(ImageProcessor ip) { |
| 34 | |
| 35 | if (noRoi) |
| 36 | ip.resetRoi(); |
| 37 | |
| 38 | if (arg.equals("invert")) { |
| 39 | ip.invert(); |
| 40 | slice++; |
| 41 | if (imp.getBitDepth()==16 && imp.getStackSize()>1 && slice==imp.getStackSize()) |
| 42 | imp.resetDisplayRange(); |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | if (arg.equals("smooth")) { |
| 47 | ip.setSnapshotCopyMode(true); |
| 48 | ip.smooth(); |
| 49 | ip.setSnapshotCopyMode(false); |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | if (arg.equals("sharpen")) { |
| 54 | ip.setSnapshotCopyMode(true); |
| 55 | ip.sharpen(); |
| 56 | ip.setSnapshotCopyMode(false); |
| 57 | return; |
| 58 | } |
| 59 | |
| 60 | if (arg.equals("edge")) { |
| 61 | ip.setSnapshotCopyMode(true); |
| 62 | ip.findEdges(); |
| 63 | ip.setSnapshotCopyMode(false); |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | if (arg.equals("add")) { |
| 68 | ip.noise(25.0); |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | if (arg.equals("noise")) { |
| 73 | if (canceled) |
| 74 | return; |
| 75 | slice++; |
| 76 | if (slice==1) { |
| 77 | GenericDialog gd = new GenericDialog("Gaussian Noise"); |
| 78 | gd.addNumericField("Standard Deviation:", sd, 2); |
| 79 | gd.showDialog(); |
| 80 | if (gd.wasCanceled()) { |
| 81 | canceled = true; |
| 82 | return; |
| 83 | } |
| 84 | sd = gd.getNextNumber(); |
| 85 | } |
| 86 | ip.noise(sd); |
| 87 | IJ.register(Filters.class); |
| 88 | return; |
| 89 | } |
| 90 |
nothing calls this directly
no test coverage detected