Ejemplo n.º 1
0
 protected void hideRois() {
   if (currentImage == null) return;
   currentImage.killRoi();
   if (currentImage.isVisible()) {
     currentImage.updateAndDraw();
     ImageUtils.removeScrollListener(currentImage, this, this);
   }
   currentImage = null;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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;
     }
   }
 }