for (int d=0; d<8; d++) { //walk around the point and note every no-line->line transition boolean pixelSet = prevPixelSet; if (isInner || isWithin(x, y, d)) { boolean isSet = (pixels[offset+dirOffset[d]]!=(byte)255); if ((d&1)==0) pixelSet = isSet; //non-diagonal directions: always regarded
for (int d=0; d<8; d++) { //walk around the point and note every no-line->line transition boolean pixelSet = prevPixelSet; if (isInner || isWithin(x, y, d)) { boolean isSet = (pixels[offset+dirOffset[d]]!=(byte)255); if ((d&1)==0) pixelSet = isSet; //non-diagonal directions: always regarded
/** delete a line starting at x, y up to the next (4-connected) vertex */ void removeLineFrom (byte[] pixels, int x, int y) { //IJ.log("del line from "+x+","+y); pixels[x + width*y] = (byte)255; //delete the first point boolean continues; do { continues = false; boolean isInner = (y!=0 && y!=height-1) && (x!=0 && x!=width-1); //not necessary, but faster than isWithin for (int d=0; d<8; d+=2) { //analyze 4-connected neighbors if (isInner || isWithin(x, y, d)) { int v = pixels[x + width*y + dirOffset[d]]; if (v!=(byte)255 && v!=0) { int nRadii = nRadii(pixels, x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d]); if (nRadii<=1) { //found a point or line end x += DIR_X_OFFSET[d]; y += DIR_Y_OFFSET[d]; pixels[x + width*y] = (byte)255; //delete the point continues = nRadii==1; //continue along that line break; } } } } // for directions d } while (continues); //IJ.log("deleted to "+x+","+y); } // void removeLineFrom
/** delete a line starting at x, y up to the next (4-connected) vertex */ void removeLineFrom (byte[] pixels, int x, int y) { //IJ.log("del line from "+x+","+y); pixels[x + width*y] = (byte)255; //delete the first point boolean continues; do { continues = false; boolean isInner = (y!=0 && y!=height-1) && (x!=0 && x!=width-1); //not necessary, but faster than isWithin for (int d=0; d<8; d+=2) { //analyze 4-connected neighbors if (isInner || isWithin(x, y, d)) { int v = pixels[x + width*y + dirOffset[d]]; if (v!=(byte)255 && v!=0) { int nRadii = nRadii(pixels, x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d]); if (nRadii<=1) { //found a point or line end x += DIR_X_OFFSET[d]; y += DIR_Y_OFFSET[d]; pixels[x + width*y] = (byte)255; //delete the point continues = nRadii==1; //continue along that line break; } } } } // for directions d } while (continues); //IJ.log("deleted to "+x+","+y); } // void removeLineFrom
for (int d=0; d<8; d++) { //analyze all neighbors (in 8 directions) at the same level int offset2 = offset+dirOffset[d]; if ((isInner || isWithin(x, y, d)) && (types[offset2]&LISTED)==0) { if ((types[offset2]&MAX_AREA)!=0 || (((types[offset2]&ELIMINATED)!=0) && (pixels[offset2]&255)>=loLevel)) { saddleFound = true; //we have reached a point touching a "true" maximum...
for (int d=0; d<8; d++) { //analyze all neighbors (in 8 directions) at the same level int offset2 = offset+dirOffset[d]; if ((isInner || isWithin(x, y, d)) && (types[offset2]&LISTED)==0) { if ((types[offset2]&MAX_AREA)!=0 || (((types[offset2]&ELIMINATED)!=0) && (pixels[offset2]&255)>=loLevel)) { saddleFound = true; //we have reached a point touching a "true" maximum...
if (isInner || isWithin(x, y, d)) { float vNeighbor = ip.getPixelValue(x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d]); float vNeighborTrue = isEDM ? trueEdmHeight(x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d], ip) : vNeighbor;
if (isInner || isWithin(x, y, d)) { float vNeighbor = ip.getPixelValue(x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d]); float vNeighborTrue = isEDM ? trueEdmHeight(x+DIR_X_OFFSET[d], y+DIR_Y_OFFSET[d], ip) : vNeighbor;
for (int d=0; d<8; d++) { //analyze all neighbors (in 8 directions) at the same level int offset2 = offset+dirOffset[d]; if ((isInner || isWithin(x, y, d)) && (types[offset2]&LISTED)==0) { if (isEDM && edmPixels[offset2]<=0) continue; //ignore the background (non-particles)
for (int d=0; d<8; d++) { //analyze all neighbors (in 8 directions) at the same level int offset2 = offset+dirOffset[d]; if ((isInner || isWithin(x, y, d)) && (types[offset2]&LISTED)==0) { if (isEDM && edmPixels[offset2]<=0) continue; //ignore the background (non-particles)
addToNext = true; //image border else for (int d=0; d<8; d++) if (isWithin(x, y, d) && pixels[pOffset+dirOffset[d]]==0) { addToNext = true; //border of area below threshold break;
addToNext = true; //image border else for (int d=0; d<8; d++) if (isWithin(x, y, d) && pixels[pOffset+dirOffset[d]]==0) { addToNext = true; //border of area below threshold break;