예제 #1
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;
     }
   }
 }