@Override public byte[] getMaskArray() { record("getMaskArray"); return proc.getMaskArray(); }
@Override public byte[] getMaskArray() { record("getMaskArray"); return proc.getMaskArray(); }
/** Fits an ellipse to the current ROI. The 'stats' argument, currently not used, can be null. The fit parameters are returned in public fields. */ public void fit(ImageProcessor ip, ImageStatistics stats) { this.ip = ip; mask = ip.getMaskArray(); Rectangle r = ip.getRoi(); left = r.x; top = r.y; width = r.width; height = r.height; getEllipseParam(); }
/** Fits an ellipse to the current ROI. The 'stats' argument, currently not used, can be null. The fit parameters are returned in public fields. */ public void fit(ImageProcessor ip, ImageStatistics stats) { this.ip = ip; mask = ip.getMaskArray(); Rectangle r = ip.getRoi(); left = r.x; top = r.y; width = r.width; height = r.height; getEllipseParam(); }
byte[] mask = ip.getMaskArray(); int i, mi; float v;
void getCentroid(ImageProcessor ip) { byte[] mask = ip.getMaskArray(); int count=0, mi; double xsum=0.0, ysum=0.0; for (int y=ry,my=0; y<(ry+rh); y++,my++) { mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { count++; xsum += x; ysum += y; } } } xCentroid = xsum/count+0.5; yCentroid = ysum/count+0.5; if (cal!=null) { xCentroid = cal.getX(xCentroid); yCentroid = cal.getY(yCentroid, height); } }
void getCentroid(ImageProcessor ip) { byte[] mask = ip.getMaskArray(); int count=0, mi; double xsum=0.0, ysum=0.0; for (int y=ry,my=0; y<(ry+rh); y++,my++) { mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { count++; xsum += x; ysum += y; } } } xCentroid = xsum/count+0.5; yCentroid = ysum/count+0.5; if (cal!=null) { xCentroid = cal.getX(xCentroid); yCentroid = cal.getY(yCentroid, height); } }
void calculateMoments(ImageProcessor ip, double minThreshold, double maxThreshold) { float[] pixels = (float[])ip.getPixels(); byte[] mask = ip.getMaskArray(); int i, mi; double v, v2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void calculateMoments(ImageProcessor ip) { byte[] mask = ip.getMaskArray(); int i, mi; double v, v2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void calculateMoments(ImageProcessor ip, int minThreshold, int maxThreshold, float[] cTable) { short[] pixels = (short[])ip.getPixels(); byte[] mask = ip.getMaskArray(); int i, mi, iv; double v, v2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void calculateMoments(ImageProcessor ip, int minThreshold, int maxThreshold, float[] cTable) { byte[] pixels = (byte[])ip.getPixels(); byte[] mask = ip.getMaskArray(); int v, i, mi; double dv, dv2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void calculateMoments(ImageProcessor ip) { byte[] mask = ip.getMaskArray(); int i, mi; double v, v2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void calculateMoments(ImageProcessor ip, int minThreshold, int maxThreshold, float[] cTable) { short[] pixels = (short[])ip.getPixels(); byte[] mask = ip.getMaskArray(); int i, mi, iv; double v, v2, sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0, xsum=0.0, ysum=0.0;
void getCentroid(ImageProcessor ip, double minThreshold, double maxThreshold) { float[] pixels = (float[])ip.getPixels(); byte[] mask = ip.getMaskArray(); double count=0.0, xsum=0.0, ysum=0.0, v; int i, mi; for (int y=ry,my=0; y<(ry+rh); y++,my++) { i = y*width + rx; mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { v = pixels[i]; if (v>=minThreshold && v<=maxThreshold) { count++; xsum+=x; ysum+=y; } } i++; } } xCentroid = xsum/count+0.5; yCentroid = ysum/count+0.5; if (cal!=null) { xCentroid = cal.getX(xCentroid); yCentroid = cal.getY(yCentroid, height); } }
void getCentroid(ImageProcessor ip, double minThreshold, double maxThreshold) { float[] pixels = (float[])ip.getPixels(); byte[] mask = ip.getMaskArray(); double count=0.0, xsum=0.0, ysum=0.0, v; int i, mi; for (int y=ry,my=0; y<(ry+rh); y++,my++) { i = y*width + rx; mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { v = pixels[i]; if (v>=minThreshold && v<=maxThreshold) { count++; xsum+=x; ysum+=y; } } i++; } } xCentroid = xsum/count+0.5; yCentroid = ysum/count+0.5; if (cal!=null) { xCentroid = cal.getX(xCentroid); yCentroid = cal.getY(yCentroid, height); } }
void calculateAreaFraction(ImageProcessor ip) { int sum = 0; int total = 0; float t1 = (float)ip.getMinThreshold(); float t2 = (float)ip.getMaxThreshold(); float v; float[] pixels = (float[])ip.getPixels(); boolean noThresh = t1==ImageProcessor.NO_THRESHOLD; byte[] mask = ip.getMaskArray(); int i, mi; for (int y=ry,my=0; y<(ry+rh); y++,my++) { i = y*width + rx; mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { v = pixels[i]; total++; if (noThresh) { if (v!=0f) sum++; } else if (v>=t1 && v<=t2) sum++; } i++; } } areaFraction = sum*100.0/total; }
void calculateAreaFraction(ImageProcessor ip) { int sum = 0; int total = 0; float t1 = (float)ip.getMinThreshold(); float t2 = (float)ip.getMaxThreshold(); float v; float[] pixels = (float[])ip.getPixels(); boolean noThresh = t1==ImageProcessor.NO_THRESHOLD; byte[] mask = ip.getMaskArray(); int i, mi; for (int y=ry,my=0; y<(ry+rh); y++,my++) { i = y*width + rx; mi = my*rw; for (int x=rx; x<(rx+rw); x++) { if (mask==null||mask[mi++]!=0) { v = pixels[i]; total++; if (noThresh) { if (v!=0f) sum++; } else if (v>=t1 && v<=t2) sum++; } i++; } } areaFraction = sum*100.0/total; }
void getCentroid(ImageProcessor ip, int minThreshold, int maxThreshold) { byte[] pixels = (byte[])ip.getPixels(); byte[] mask = ip.getMaskArray(); boolean limit = minThreshold>0 || maxThreshold<255; double xsum=0, ysum=0;
void getCentroid(ImageProcessor ip, int minThreshold, int maxThreshold) { short[] pixels = (short[])ip.getPixels(); byte[] mask = ip.getMaskArray(); boolean limit = minThreshold>0 || maxThreshold<65535; int count=0, i, mi, v;
void getCentroid(ImageProcessor ip, int minThreshold, int maxThreshold) { byte[] pixels = (byte[])ip.getPixels(); byte[] mask = ip.getMaskArray(); boolean limit = minThreshold>0 || maxThreshold<255; double xsum=0, ysum=0;