static float[] makeXArray(double value, ImagePlus imp) { float[] array = new float[1]; array[0] = (float)(imp!=null?imp.getCanvas().offScreenXD((int)value):value); return array; }
static float[] makeXArray(double value, ImagePlus imp) { float[] array = new float[1]; array[0] = (float)(imp!=null?imp.getCanvas().offScreenXD((int)value):value); return array; }
public double getOffscreenXDouble(MouseEvent e) { ImageCanvas canvas = getImageCanvas(e); return canvas == null ? -1 : canvas.offScreenXD(e.getX()); }
public double getOffscreenYDouble(MouseEvent e) { ImageCanvas canvas = getImageCanvas(e); return canvas == null ? -1 : canvas.offScreenXD(e.getY()); }
protected void handleMouseDown(int sx, int sy) { super.handleMouseDown(sx, sy); startxd = ic.offScreenXD(sx); startyd = ic.offScreenYD(sy); }
public EllipseRoi(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); type = FREEROI; xstart = ic.offScreenXD(sx); ystart = ic.offScreenYD(sy); setDrawOffset(false); bounds = null; }
protected void handleMouseDown(int sx, int sy) { super.handleMouseDown(sx, sy); startxd = ic!=null?ic.offScreenXD(sx):sx; startyd = ic!=null?ic.offScreenYD(sy):sy; }
protected void handleMouseDown(int sx, int sy) { super.handleMouseDown(sx, sy); startxd = ic.offScreenXD(sx); startyd = ic.offScreenYD(sy); }
protected void handleMouseDown(int sx, int sy) { super.handleMouseDown(sx, sy); startxd = ic!=null?ic.offScreenXD(sx):sx; startyd = ic!=null?ic.offScreenYD(sy):sy; }
public EllipseRoi(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); type = FREEROI; xstart = ic.offScreenXD(sx); ystart = ic.offScreenYD(sy); setDrawOffset(false); bounds = null; }
/** Starts the process of creating a new user-generated straight line selection. 'sx' and 'sy' are screen coordinates that specify the start of the line. The user will determine the end of the line interactively using rubber banding. */ public Line(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); startxd = ic.offScreenXD(sx); startyd = ic.offScreenYD(sy); x1R = x2R = startxd - startX; y1R = y2R = startyd - startY; type = LINE; if (!(this instanceof Arrow) && lineWidth>1) updateWideLine(lineWidth); drawOffset = Prefs.subPixelResolution; }
protected void grow(int sx, int sy) { double x1 = xstart; double y1 = ystart; double x2 = ic.offScreenXD(sx); double y2 = ic.offScreenYD(sy); makeRectangle(x1, y1, x2, y2); imp.draw(); }
protected void grow(int sx, int sy) { double x1 = xstart; double y1 = ystart; double x2 = ic.offScreenXD(sx); double y2 = ic.offScreenYD(sy); makeEllipse(x1, y1, x2, y2); imp.draw(); }
protected void handleMouseDown(int sx, int sy) { if (state==NORMAL && ic!=null) { state = MOVING; startX = ic.offScreenX(sx); startY = ic.offScreenY(sy); startXD = ic.offScreenXD(sx); startYD = ic.offScreenYD(sy); //showStatus(); } }
protected void grow(int sx, int sy) { double x1 = xstart; double y1 = ystart; double x2 = ic.offScreenXD(sx); double y2 = ic.offScreenYD(sy); makeRectangle(x1, y1, x2, y2); imp.draw(); }
protected void grow(int sx, int sy) { double x1 = xstart; double y1 = ystart; double x2 = ic.offScreenXD(sx); double y2 = ic.offScreenYD(sy); makeEllipse(x1, y1, x2, y2); imp.draw(); }
protected void handleMouseDown(int sx, int sy) { if (state==NORMAL && ic!=null) { state = MOVING; startX = ic.offScreenX(sx); startY = ic.offScreenY(sy); startXD = ic.offScreenXD(sx); startYD = ic.offScreenYD(sy); //showStatus(); } }
private Spot makeSpot( final ImagePlus lImp, HyperStackDisplayer displayer, final ImageCanvas canvas, Point mouseLocation ) { if ( displayer == null ) { displayer = displayers.get( lImp ); } if ( mouseLocation == null ) { mouseLocation = MouseInfo.getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen( mouseLocation, canvas ); } final double[] calibration = TMUtils.getSpatialCalibration( lImp ); return new Spot( ( -0.5d + canvas.offScreenXD( mouseLocation.x ) ) * calibration[ 0 ], ( -0.5d + canvas.offScreenYD( mouseLocation.y ) ) * calibration[ 1 ], ( lImp.getSlice() - 1 ) * calibration[ 2 ], FALL_BACK_RADIUS, -1d ); }
public RotatedRectRoi(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); type = FREEROI; xstart = ic.offScreenXD(sx); ystart = ic.offScreenYD(sy); ImageWindow win = imp.getWindow(); int pixels = win!=null?(int)(win.getSize().height/win.getCanvas().getMagnification()):imp.getHeight(); if (IJ.debugMode) IJ.log("RotatedRectRoi: "+(int)rectWidth+" "+pixels); if (rectWidth>pixels) rectWidth = pixels/3; setDrawOffset(false); bounds = null; }
public RotatedRectRoi(int sx, int sy, ImagePlus imp) { super(sx, sy, imp); type = FREEROI; xstart = ic.offScreenXD(sx); ystart = ic.offScreenYD(sy); ImageWindow win = imp.getWindow(); int pixels = win!=null?(int)(win.getSize().height/win.getCanvas().getMagnification()):imp.getHeight(); if (IJ.debugMode) IJ.log("RotatedRectRoi: "+(int)rectWidth+" "+pixels); if (rectWidth>pixels) rectWidth = pixels/3; setDrawOffset(false); bounds = null; }