/** Sets the color used used for the ROI Manager "Show All" mode. */
 public static void setShowAllColor(Color c) {
   if (c == null) return;
   showAllColor = c;
   labelColor = null;
   ImagePlus img = WindowManager.getCurrentImage();
   if (img != null) {
     ImageCanvas ic = img.getCanvas();
     if (ic != null && ic.getShowAllROIs()) img.draw();
   }
 }
Exemple #2
0
 private boolean deleteOverlayRoi(ImagePlus imp) {
   if (imp == null) return false;
   Overlay overlay = null;
   ImageCanvas ic = imp.getCanvas();
   if (ic != null) overlay = ic.getShowAllList();
   if (overlay == null) overlay = imp.getOverlay();
   if (overlay == null) return false;
   Roi roi = imp.getRoi();
   for (int i = 0; i < overlay.size(); i++) {
     Roi roi2 = overlay.get(i);
     if (roi2 == roi) {
       overlay.remove(i);
       imp.deleteRoi();
       ic = imp.getCanvas();
       if (ic != null) ic.roiManagerSelect(roi, true);
       return true;
     }
   }
   return false;
 }
Exemple #3
0
 public StackWindow(ImagePlus imp, ImageCanvas ic) {
   super(imp, ic);
   addScrollbars(imp);
   addMouseWheelListener(this);
   if (sliceSelector == null && this.getClass().getName().indexOf("Image5D") != -1)
     sliceSelector = new Scrollbar(); // prevents Image5D from crashing
   // IJ.log(nChannels+" "+nSlices+" "+nFrames);
   pack();
   ic = imp.getCanvas();
   if (ic != null) ic.setMaxBounds();
   show();
   int previousSlice = imp.getCurrentSlice();
   if (previousSlice > 1 && previousSlice <= imp.getStackSize()) imp.setSlice(previousSlice);
   else imp.setSlice(1);
   thread = new Thread(this, "zSelector");
   thread.start();
 }