protected ImagePlus doRegistration(ImagePlus image, boolean showSpreadsheet) { Roi[] rois = getRois(image); if (rois == null) return null; PolygonRoi[] polygons = new PolygonRoi[rois.length]; System.arraycopy(rois, 0, polygons, 0, rois.length); return showKymograph(image, polygons, Line.getWidth(), showSpreadsheet, false); }
@Override public Line convert(final ij.gui.Line src) { if (log != null && ij.gui.Line.getWidth() > 1) { log.warn("Ignoring line width >1."); } return new IJLineWrapper(src); }
protected ImagePlus getStraightenedStack(ImagePlus image) { if (image == null) return null; return getStraightenedStack(image, Line.getWidth(), getRois(image)); }
public synchronized void textValueChanged(TextEvent e) { int width = (int)Tools.parseDouble(tf.getText(), -1); //IJ.log(""+width); if (width==-1) return; if (width<0) width=1; if (width!=Line.getWidth()) { slider.setValue(width); value = width; notify(); } } void setup() {
public synchronized void textValueChanged(TextEvent e) { int width = (int)Tools.parseDouble(tf.getText(), -1); //IJ.log(""+width); if (width==-1) return; if (width<0) width=1; if (width!=Line.getWidth()) { slider.setValue(width); value = width; notify(); } } void setup() {
@Override public void mouseWheelMoved(MouseWheelEvent e) { if ((e.getModifiersEx() & (e.CTRL_DOWN_MASK | e.ALT_DOWN_MASK)) == e.CTRL_DOWN_MASK) { int newWidth = Line.getWidth() - e.getWheelRotation(); Line.setWidth(newWidth); if (roi != null) { roi.updateWideLine(newWidth); getImagePlus(e).setRoi(roi); } e.consume(); } }
public static void update() { if (instance==null) return; instance.checkbox.setState(instance.isSplineFit()); int sliderWidth = instance.slider.getValue(); int lineWidth = Line.getWidth(); if (lineWidth!=sliderWidth && lineWidth<=200) { instance.slider.setValue(lineWidth); instance.tf.setText(""+lineWidth); } }
public static void update() { if (instance==null) return; instance.checkbox.setState(instance.isSplineFit()); int sliderWidth = instance.slider.getValue(); int lineWidth = Line.getWidth(); if (lineWidth!=sliderWidth && lineWidth<=200) { instance.slider.setValue(lineWidth); instance.tf.setText(""+lineWidth); } }
void lineWidth() { int width = (int)IJ.getNumber("Line Width:", Line.getWidth()); if (width==IJ.CANCELED) return; Line.setWidth(width); LineWidthAdjuster.update(); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.isProcessor()) { ImageProcessor ip = imp.getProcessor(); ip.setLineWidth(Line.getWidth()); Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) imp.draw(); } }
void lineWidth() { int width = (int)IJ.getNumber("Line Width:", Line.getWidth()); if (width==IJ.CANCELED) return; Line.setWidth(width); LineWidthAdjuster.update(); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.isProcessor()) { ImageProcessor ip = imp.getProcessor(); ip.setLineWidth(Line.getWidth()); Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) imp.draw(); } }
/** Draws an outline of this OvalRoi on the image. */ public void drawPixels(ImageProcessor ip) { Polygon p = getPolygon(); if (p.npoints>0) { int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); ip.drawPolygon(p); ip.setLineWidth(saveWidth); } if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Draws an outline of this OvalRoi on the image. */ public void drawPixels(ImageProcessor ip) { Polygon p = getPolygon(); if (p.npoints>0) { int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); ip.drawPolygon(p); ip.setLineWidth(saveWidth); } if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
private static void updateRoi() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) { roi.updateWideLine(Line.getWidth()); imp.draw(); return; } } if (Roi.previousRoi==null) return; int id = Roi.previousRoi.getImageID(); if (id>=0) return; imp = WindowManager.getImage(id); if (imp==null) return; Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) { roi.updateWideLine(Line.getWidth()); imp.draw(); } }
private static void updateRoi() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) { roi.updateWideLine(Line.getWidth()); imp.draw(); return; } } if (Roi.previousRoi==null) return; int id = Roi.previousRoi.getImageID(); if (id>=0) return; imp = WindowManager.getImage(id); if (imp==null) return; Roi roi = imp.getRoi(); if (roi!=null && roi.isLine()) { roi.updateWideLine(Line.getWidth()); imp.draw(); } }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Process a stack or part of it. The slice given by class variable * processedAsPreview remains unchanged. * @param firstSlice Slice number of the first slice to be processed * @param endSlice Slice number of the last slice to be processed */ private void processStack(int firstSlice, int endSlice) { ImageStack stack = imp.getStack(); ImageProcessor ip = stack.getProcessor(firstSlice); prepareProcessor(ip, imp); ip.setLineWidth(Line.getWidth()); //in contrast to imp.getProcessor, stack.getProcessor does not do this FloatProcessor fp = null; int slices = imp.getNSlices(); for (int i=firstSlice; i<=endSlice; i++) { if (i != processedAsPreview) { announceSliceNumber(i); ip.setPixels(stack.getPixels(i)); ip.setSliceNumber(i); processOneImage(ip, fp, false); if (IJ.escapePressed()) {IJ.beep(); break;} } } }
/** Process a stack or part of it. The slice given by class variable * processedAsPreview remains unchanged. * @param firstSlice Slice number of the first slice to be processed * @param endSlice Slice number of the last slice to be processed */ private void processStack(int firstSlice, int endSlice) { ImageStack stack = imp.getStack(); ImageProcessor ip = stack.getProcessor(firstSlice); prepareProcessor(ip, imp); ip.setLineWidth(Line.getWidth()); //in contrast to imp.getProcessor, stack.getProcessor does not do this FloatProcessor fp = null; int slices = imp.getNSlices(); for (int i=firstSlice; i<=endSlice; i++) { if (i != processedAsPreview) { announceSliceNumber(i); ip.setPixels(stack.getPixels(i)); ip.setSliceNumber(i); processOneImage(ip, fp, false); if (IJ.escapePressed()) {IJ.beep(); break;} } } }
/** Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated. */ public ImageProcessor getProcessor() { if (ip==null) return null; if (roi!=null && roi.isArea()) ip.setRoi(roi.getBounds()); else ip.resetRoi(); if (!compositeImage) ip.setLineWidth(Line.getWidth()); if (ij!=null) ip.setProgressBar(ij.getProgressBar()); Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null); if (Recorder.record) { Recorder recorder = Recorder.getInstance(); if (recorder!=null) recorder.imageUpdated(this); } return ip; }
/** Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated. */ public ImageProcessor getProcessor() { if (ip==null) return null; if (roi!=null && roi.isArea()) ip.setRoi(roi.getBounds()); else ip.resetRoi(); if (!compositeImage) ip.setLineWidth(Line.getWidth()); if (ij!=null) ip.setProgressBar(ij.getProgressBar()); Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null); if (Recorder.record) { Recorder recorder = Recorder.getInstance(); if (recorder!=null) recorder.imageUpdated(this); } return ip; }