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