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

Method run

ij/src/main/java/ij/plugin/filter/Rotator.java:55–94  ·  view source on GitHub ↗
(ImageProcessor ip)

Source from the content-addressed store, hash-verified

53 }
54
55 public void run(ImageProcessor ip) {
56 if (enlarge && gd.wasOKed()) synchronized(this) {
57 if (!isEnlarged) {
58 enlargeCanvas();
59 isEnlarged=true;
60 }
61 }
62 if (isEnlarged) { //enlarging may have made the ImageProcessor invalid, also for the parallel threads
63 int slice = pfr.getSliceNumber();
64 if (imp.getStackSize()==1)
65 ip = imp.getProcessor();
66 else
67 ip = imp.getStack().getProcessor(slice);
68 }
69 ip.setInterpolationMethod(interpolationMethod);
70 if (fillWithBackground)
71 ip.setBackgroundColor(Toolbar.getBackgroundColor());
72 else
73 ip.setBackgroundValue(0);
74 ip.rotate(angle);
75 if (!gd.wasOKed())
76 drawGridLines(gridLines);
77 if (overlay!=null && !imp.getHideOverlay()) {
78 Overlay overlay2 = overlay.rotate(angle, ip.getWidth()/2, ip.getHeight()/2);
79 if (overlay2!=null && overlay2.size()>0)
80 imp.setOverlay(overlay2);
81 }
82 if (isEnlarged && imp.getStackSize()==1) {
83 imp.changes = true;
84 imp.updateAndDraw();
85 Undo.setup(Undo.COMPOUND_FILTER_DONE, imp);
86 }
87 if (done) { // remove grid
88 Overlay ovly = imp.getOverlay();
89 if (ovly!=null) {
90 ovly.remove(GRID);
91 if (ovly.size()==0) imp.setOverlay(null);
92 }
93 }
94 }
95
96 void enlargeCanvas() {
97 imp.unlock();

Callers

nothing calls this directly

Calls 15

enlargeCanvasMethod · 0.95
getBackgroundColorMethod · 0.95
drawGridLinesMethod · 0.95
sizeMethod · 0.95
setupMethod · 0.95
removeMethod · 0.95
getHideOverlayMethod · 0.80
wasOKedMethod · 0.45
getSliceNumberMethod · 0.45
getStackSizeMethod · 0.45
getProcessorMethod · 0.45

Tested by

no test coverage detected