示例#1
0
 protected void hideRois() {
   if (currentImage == null) return;
   currentImage.killRoi();
   if (currentImage.isVisible()) {
     currentImage.updateAndDraw();
     ImageUtils.removeScrollListener(currentImage, this, this);
   }
   currentImage = null;
 }
示例#2
0
 protected void updateRoi() {
   // System.out.println("image:"+currentImage.getTitle()+ " slice:"+currentImage.getSlice());
   Roi r = currentROIs.get(currentImage.getSlice());
   if (r != null) {
     currentImage.setRoi(r);
   } else {
     currentImage.killRoi();
   }
   currentImage.updateAndDraw();
 }
示例#3
0
 protected void registerActiveImage() {
   ImagePlus activeImage = WindowManager.getCurrentImage();
   if (activeImage != null
       && activeImage.getProcessor() != null) { // && activeImage.getImageStackSize() > 1
     if (currentImage != null && currentImage.getWindow() != null && currentImage != activeImage) {
       // System.out.println("remove listener:"+currentImage.getTitle());
       ImageUtils.removeScrollListener(currentImage, this, this);
       currentImage.killRoi();
       currentImage.updateAndDraw();
       currentImage = null;
     }
     if (currentImage != activeImage) {
       // System.out.println("add listener:"+activeImage.getTitle());
       ImageUtils.addScrollListener(activeImage, this, this);
       this.currentImage = activeImage;
     }
   }
 }