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

Method setup

ij/src/main/java/ij/plugin/filter/Rotator.java:28–53  ·  view source on GitHub ↗
(String arg, ImagePlus imp)

Source from the content-addressed store, hash-verified

26 private boolean done;
27
28 public int setup(String arg, ImagePlus imp) {
29 this.imp = imp;
30 if (imp!=null) {
31 bitDepth = imp.getBitDepth();
32 Roi roi = imp.getRoi();
33 if (roi!=null && roi.isLine())
34 roi = null;
35 overlay = imp.getOverlay();
36 if (roi!=null && overlay!=null && Macro.getOptions()==null) {
37 String msg = "This image has an overlay so the\nselection will be removed.";
38 if (!IJ.showMessageWithCancel("Rotator", msg))
39 return DONE;
40 imp.deleteRoi();
41 }
42 Rectangle r = roi!=null?roi.getBounds():null;
43 canEnlarge = r==null || (r.x==0&&r.y==0&&r.width==imp.getWidth()&&r.height==imp.getHeight());
44 if (imp.getDisplayMode()==IJ.COMPOSITE) { // setup Undo for composite color stacks
45 Undo.setup(Undo.TRANSFORM, imp);
46 flags = flags | NO_UNDO_RESET;
47 }
48 Undo.saveOverlay(imp);
49 if (overlay==null)
50 overlay = new Overlay();
51 }
52 return flags;
53 }
54
55 public void run(ImageProcessor ip) {
56 if (enlarge && gd.wasOKed()) synchronized(this) {

Callers

nothing calls this directly

Calls 13

isLineMethod · 0.95
getOptionsMethod · 0.95
showMessageWithCancelMethod · 0.95
getBoundsMethod · 0.95
setupMethod · 0.95
saveOverlayMethod · 0.95
deleteRoiMethod · 0.80
getBitDepthMethod · 0.45
getRoiMethod · 0.45
getOverlayMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected