@Override public void drawDot(int xcenter, int ycenter) { record("drawDot", new Object[] {new Integer(xcenter), new Integer(ycenter)}, new Class[] {int.class, int.class}); proc.drawDot(xcenter, ycenter); }
drawDot2((int)Math.round(x), (int)Math.round(y)); else drawDot((int)Math.round(x), (int)Math.round(y)); x += xinc; y += yinc;
@Override public void drawDot(int xcenter, int ycenter) { record("drawDot", new Object[] {new Integer(xcenter), new Integer(ycenter)}, new Class[] {int.class, int.class}); proc.drawDot(xcenter, ycenter); }
drawDot2((int)Math.round(x), (int)Math.round(y)); else drawDot((int)Math.round(x), (int)Math.round(y)); x += xinc; y += yinc;
for (int dy=-r; dy<=r; dy++) for (int dx=-r; dx<=r; dx++) ip.drawDot(x0+dx, y0+dy); break; case TRIANGLE: int dx = (int)(Math.round(halfWidth)); for (int x=x0-dx; x<=x0+dx; x++) ip.drawDot(x,y); int dx = (int)(Math.round(halfWidth-(hwStep+1)*Math.abs(y-y0))); for (int x=x0-dx; x<=x0+dx; x++) ip.drawDot(x,y); for (int dx=-r; dx<=r; dx++) if (dx*dx + dy*dy <= rsquare) ip.drawDot(x0+dx, y0+dy); break;
for (int dy=-r; dy<=r; dy++) for (int dx=-r; dx<=r; dx++) ip.drawDot(x0+dx, y0+dy); break; case TRIANGLE: int dx = (int)(Math.round(halfWidth)); for (int x=x0-dx; x<=x0+dx; x++) ip.drawDot(x,y); int dx = (int)(Math.round(halfWidth-(hwStep+1)*Math.abs(y-y0))); for (int x=x0-dx; x<=x0+dx; x++) ip.drawDot(x,y); for (int dx=-r; dx<=r; dx++) if (dx*dx + dy*dy <= rsquare) ip.drawDot(x0+dx, y0+dy); break;
double getColorValue(Color color) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()==24) return color.getRGB()&0xffffff; ImageProcessor ip = imp.getProcessor(); ip.setRoi(0,0,1,1); ip = ip.crop(); ip.setColor(color); ip.drawDot(0,0); return ip.getf(0,0); }
double getColorValue(Color color) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()==24) return color.getRGB()&0xffffff; ImageProcessor ip = imp.getProcessor(); ip.setRoi(0,0,1,1); ip = ip.crop(); ip.setColor(color); ip.drawDot(0,0); return ip.getf(0,0); }
break; case DOT: ip.drawDot(x, y); //uses current line width break; case CUSTOM:
final static public void drawLocalPoints( final ImageProcessor ip, final Collection< ? extends Point > points, final Color color, final int width, final Rectangle srcRect, final double magnification ) { final int oldLineWidth = ip.getLineWidth(); ip.setColor( color ); ip.setLineWidth( width ); for ( final Point p : points ) { final double[] l = p.getL(); final double x = ( l[ 0 ] + srcRect.x ) * magnification; final double y = ( l[ 1 ] + srcRect.y ) * magnification; ip.drawDot( Util.round( x ), Util.round( y ) ); } ip.setLineWidth( oldLineWidth ); }
final static public void drawWorldPoints( final ImageProcessor ip, final Collection< ? extends Point > points, final Color color, final int width, final Rectangle srcRect, final double magnification ) { final int oldLineWidth = ip.getLineWidth(); ip.setColor( color ); ip.setLineWidth( width ); for ( final Point p : points ) { final double[] w = p.getW(); final double x = ( w[ 0 ] + srcRect.x ) * magnification; final double y = ( w[ 1 ] + srcRect.y ) * magnification; ip.drawDot( Util.round( x ), Util.round( y ) ); } ip.setLineWidth( oldLineWidth ); }
break; case DOT: ip.drawDot(x, y); //uses current line width break; case CUSTOM:
final static public void drawLocalPoints( final ImageProcessor ip, final Collection< ? extends Point > points, final Color color, final int width, final Rectangle srcRect, final double magnification ) { final int oldLineWidth = ip.getLineWidth(); ip.setColor( color ); ip.setLineWidth( width ); for ( final Point p : points ) { final double[] l = p.getL(); final double x = ( l[ 0 ] + srcRect.x ) * magnification; final double y = ( l[ 1 ] + srcRect.y ) * magnification; ip.drawDot( Util.round( x ), Util.round( y ) ); } ip.setLineWidth( oldLineWidth ); }
final static public void drawWorldPoints( final ImageProcessor ip, final Collection< ? extends Point > points, final Color color, final int width, final Rectangle srcRect, final double magnification ) { final int oldLineWidth = ip.getLineWidth(); ip.setColor( color ); ip.setLineWidth( width ); for ( final Point p : points ) { final double[] w = p.getW(); final double x = ( w[ 0 ] + srcRect.x ) * magnification; final double y = ( w[ 1 ] + srcRect.y ) * magnification; ip.drawDot( Util.round( x ), Util.round( y ) ); } ip.setLineWidth( oldLineWidth ); }
if (drawDots){ ip.setLineWidth(dotSize); ip.drawDot(x, y); }else{ ip.putPixel(x, y, currVal);
void Dots(){ dotsize=(int) Tools.parseDouble(dotsizefield.getText()); j=0; int nbtrackold=1; for (i=0; i<(rt.getCounter()); i++) { int nbtrack=(int) rt.getValue(0,i); int nbslices=(int) rt.getValue(1,i); int cx=(int) rt.getValue(2,i); int cy=(int) rt.getValue(3,i); if ((nbtrack != nbtrackold)) j++; if (j>6) j=0; ImageProcessor ip= stack.getProcessor(nbslices); ip.setColor(col[j]); ip.setLineWidth(dotsize); ip.drawDot(cx, cy); if (checkText.getState()){ Font font = new Font("SansSerif", Font.PLAIN, (int) Tools.parseDouble(fontsizefield.getText())); ip.setFont(font); ip.drawString(""+nbtrack, cx+(dotsize-5)/2, cy-(dotsize-5)/2); } nbtrackold=nbtrack; } }
final double[] m_p2 = m.getP2().getL(); ip3.drawDot( ( int )Math.round( vis_scale * m_p2[ 0 ] ), ( int )Math.round( vis_scale * m_p2[ 1 ] ) ); ip4.drawDot( ( int )Math.round( vis_scale * m_p1[ 0 ] ), ( int )Math.round( vis_scale * m_p1[ 1 ] ) ); final double[] m_p2 = m.getP2().getL(); ip3.drawDot( ( int )Math.round( vis_scale * m_p2[ 0 ] ), ( int )Math.round( vis_scale * m_p2[ 1 ] ) ); ip4.drawDot( ( int )Math.round( vis_scale * m_p1[ 0 ] ), ( int )Math.round( vis_scale * m_p1[ 1 ] ) );
final double[] m_p2 = m.getP2().getL(); ip3.drawDot( ( int )Math.round( vis_scale * m_p2[ 0 ] ), ( int )Math.round( vis_scale * m_p2[ 1 ] ) ); ip4.drawDot( ( int )Math.round( vis_scale * m_p1[ 0 ] ), ( int )Math.round( vis_scale * m_p1[ 1 ] ) ); final double[] m_p2 = m.getP2().getL(); ip3.drawDot( ( int )Math.round( vis_scale * m_p2[ 0 ] ), ( int )Math.round( vis_scale * m_p2[ 1 ] ) ); ip4.drawDot( ( int )Math.round( vis_scale * m_p1[ 0 ] ), ( int )Math.round( vis_scale * m_p1[ 1 ] ) );
double dist = calculateDistance(xt1, yt1, xt2, yt2); if (xt1==xt2 && yt1==yt2) ip.drawDot(xt1, yt1); else if (dist < sc(1.5f*MIN_ARROWHEAD_LENGTH)) ip.drawLine(xt1, yt1, xt2, yt2); int n = (int)(length/plotObject.step); for (int i = 0; i<=n; i++) ip.drawDot(ix1 + (int)Math.round((ix2-ix1)*(double)i/n), iy1 + (int)Math.round((iy2-iy1)*(double)i/n)); ip.setClipRect(null); break;
double dist = calculateDistance(xt1, yt1, xt2, yt2); if (xt1==xt2 && yt1==yt2) ip.drawDot(xt1, yt1); else if (dist < sc(1.5f*MIN_ARROWHEAD_LENGTH)) ip.drawLine(xt1, yt1, xt2, yt2); int n = (int)(length/plotObject.step); for (int i = 0; i<=n; i++) ip.drawDot(ix1 + (int)Math.round((ix2-ix1)*(double)i/n), iy1 + (int)Math.round((iy2-iy1)*(double)i/n)); ip.setClipRect(null); break;