/** Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel. */ public void updateChannelAndDraw() { updateAndDraw(); }
/** Sets the Paste transfer mode. @see ij.process.Blitter */ public static void setPasteMode(int transferMode) { if (transferMode==pasteMode) return; pasteMode = transferMode; ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) imp.updateAndDraw(); }
void updateScreen(ImagePlus imp) { if (showUpdates) imp.updateAndDraw(); IJ.showStatus((counter++) + "/"+72); }
/** Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE. */ public void setDisplayMode(int mode) { if (this instanceof CompositeImage) { ((CompositeImage)this).setMode(mode); updateAndDraw(); } }
/** Resets the minimum and maximum displayed pixel values of the specified image to be the same as the min and max pixel values. */ public static void resetMinAndMax(ImagePlus img) { img.resetDisplayRange(); img.updateAndDraw(); }
public void setSelectedSigmaIndex( int selectedSigmaIndex ) { this.selectedSigmaIndex = selectedSigmaIndex; if( listener != null && selectedSigmaIndex >= 0 ) listener.newSigmaSelected( sigmaValues[selectedSigmaIndex] ); paletteImage.updateAndDraw(); }
private void updateThreshold(ImagePlus imp) { ImageProcessor ip = imp.getProcessor(); if (method.equals("Default") && background.equals("Default")) ip.setAutoThreshold(ImageProcessor.ISODATA2, ImageProcessor.RED_LUT); else ip.setAutoThreshold(method, !background.equals("Light"), ImageProcessor.RED_LUT); imp.updateAndDraw(); }
/** Sets the rounded rectangle corner diameter (pixels). */ public void setCornerDiameter(int cornerDiameter) { if (cornerDiameter<0) cornerDiameter = 0; this.cornerDiameter = cornerDiameter; ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && this==imp.getRoi()) imp.updateAndDraw(); }
void updateDisplay() { if (updateNeeded && WindowManager.getImageCount()>0) { ImagePlus imp = getImage(); imp.updateAndDraw(); updateNeeded = false; } }
/** Draws the histogram using the specified title and ImageStatistics. */ public void showHistogram(double min, double max) { setup(); drawHistogram(this.imp.getProcessor()); this.imp.updateAndDraw(); }
void setup() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { setup(imp); updatePlot(); updateLabels(imp); imp.updateAndDraw(); } }
/** Converts the current image from RGB to YUV and stores * the results in the same RGB image R=Y, G=U, B=V. * Author: Gabriel Landini, G.Landini@bham.ac.uk */ public static void RGBtoYUV() { ImagePlus imp = IJ.getImage(); if (imp.getBitDepth()==24) { RGBtoYUV(imp.getProcessor()); imp.updateAndDraw(); } }
/** Disables thresholding on the specified image. */ public static void resetThreshold(ImagePlus img) { ImageProcessor ip = img.getProcessor(); ip.resetThreshold(); ip.setLutAnimation(true); img.updateAndDraw(); ThresholdAdjuster.update(); }
private static void setMinAndMax(ImagePlus img, double min, double max, int channels) { Calibration cal = img.getCalibration(); min = cal.getRawValue(min); max = cal.getRawValue(max); if (channels==7) img.setDisplayRange(min, max); else img.setDisplayRange(min, max, channels); img.updateAndDraw(); }
void drawScaleBar(ImagePlus imp) { if (!updateLocation()) return; Undo.setup(Undo.FILTER, imp); drawScaleBar(imp.getProcessor(), getUnits(imp)); imp.updateAndDraw(); }
public void adjustmentValueChanged(AdjustmentEvent e) { minThreshold = minSlider.getValue(); maxThreshold = maxSlider.getValue(); erodeDilateIterations = iterationSlider.getValue(); showBinary = binary.getState(); apply(); image.updateAndDraw(); } };
public static ImagePlus FloatArrayToImagePlus(FloatArray2D image, String name, float min, float max) { ImagePlus imp = IJ.createImage(name,"32-Bit Black", image.width, image.height, 1); FloatProcessor ip = (FloatProcessor)imp.getProcessor(); FloatArrayToFloatProcessor(ip, image); if (min == max) ip.resetMinAndMax(); else ip.setMinAndMax(min, max); imp.updateAndDraw(); return imp; }
@Override public void selectionChanged( final SelectionChangeEvent event ) { // Highlight selection trackOverlay.setHighlight( selectionModel.getEdgeSelection() ); spotOverlay.setSpotSelection( selectionModel.getSpotSelection() ); // Center on last spot super.selectionChanged( event ); // Redraw imp.updateAndDraw(); }
/** Draws the plot again, ignored if the plot has not been drawn before or the plot is frozen * If the ImagePlus exist, updates it and its calibration. */ public void updateImage() { if (!plotDrawn || pp.isFrozen) return; getBlankProcessor(); drawContents(ip); if (imp == null) return; adjustCalibration(imp.getCalibration()); imp.updateAndDraw(); if (ip != imp.getProcessor()) imp.setProcessor(ip); }
void toggleChannel(ImagePlus imp, int channel) { if (!imp.isComposite()) interp.error("Composite image required"); if (channel<1 || channel>imp.getNChannels()) interp.error("Invalid channel: "+channel); if (((CompositeImage)imp).getMode()!=IJ.COMPOSITE) ((CompositeImage)imp).setMode(IJ.COMPOSITE); boolean[] active = ((CompositeImage)imp).getActiveChannels(); active[channel-1] = active[channel-1]?false:true; imp.updateAndDraw(); Channels.updateChannels(); }