/** Replaces the pixel data with contents of the specified 2D int array. */ public void setIntArray(int[][] a) { for(int y=0; y<height; y++) { for(int x=0; x<width; x++) set(x, y, a[x][y]); } }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
private ImageProcessor createImage_Square10x10 () { ImageProcessor image = new ByteProcessor(30, 30); image.setValue(0); image.fill(); for (int y = 10; y < 20; y++) { for (int x = 10; x < 20; x++) { image.set(x, y, 255); } } return image; } }
/** Replaces the pixel data with contents of the specified 2D int array. */ public void setIntArray(int[][] a) { for(int y=0; y<height; y++) { for(int x=0; x<width; x++) set(x, y, a[x][y]); } }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
public void restore() { for (Point p : memory.keySet()) { data.set(p.x, p.y, memory.get(p)); } }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
public void set(int x, int y, int value) { record("set", new Object[] {new Integer(x), new Integer(y), new Integer(value)}, new Class[] {int.class, int.class, int.class}); proc.set(x, y, value); }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
public void set(int index, int value) { record("set", new Object[] {new Integer(index), new Integer(value)}, new Class[] {int.class, int.class}); proc.set(index, value); }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
public void set(int index, int value) { record("set", new Object[] {new Integer(index), new Integer(value)}, new Class[] {int.class, int.class}); proc.set(index, value); }
private ImageProcessor createImage_Square10x10 () { ImageProcessor image = new ByteProcessor(30, 30); image.setValue(0); image.fill(); for (int y = 10; y < 20; y++) { for (int x = 10; x < 20; x++) { image.set(x, y, 255); } } return image; }
public void set(int x, int y, int value) { record("set", new Object[] {new Integer(x), new Integer(y), new Integer(value)}, new Class[] {int.class, int.class, int.class}); proc.set(x, y, value); }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
public static void labelROI(Roi roi, ImageProcessor ip, int color){ Rectangle bounds = roi.getBounds(); for(int i=bounds.x;i<=bounds.x+bounds.width;i++){ for(int j=bounds.y;j<=bounds.y+bounds.height;j++){ if(roi.contains(i,j)) ip.set(i,j,color); } } }
private ImageProcessor createImage_Square10x10 () { ImageProcessor image = new ByteProcessor(30, 30); image.setValue(0); image.fill(); for (int y = 10; y < 20; y++) { for (int x = 10; x < 20; x++) { image.set(x, y, 255); } } return image; }
final static private void processGray(final ImageProcessor ip, final int value, final int min, final int max) { final int scale = max - min + 1; final Random rnd = new Random(); final int n = ip.getWidth() * ip.getHeight(); for (int i =0; i < n; ++i) { final int v = ip.get(i); if (v == value) ip.set(i, rnd.nextInt(scale) + min); } }
private ImageProcessor createImage_Square10x10 () { ImageProcessor image = new ByteProcessor(30, 30); image.setValue(0); image.fill(); for (int y = 10; y < 20; y++) { for (int x = 10; x < 20; x++) { image.set(x, y, 255); } } return image; }
public static void threshold(Roi roi, int min, int max, ImageProcessor imageData, ImageProcessor labelData, int label) { mem = new Mem(labelData); Rectangle bounds = roi.getBounds(); for (int x = bounds.x; x <= bounds.x + bounds.width; x++) { for (int y = bounds.y; y <= bounds.y + bounds.height; y++) { if (roi.contains(x,y) && imageData.get(x, y) >= min && imageData.get(x, y) <= max) { mem.rememberPixel(x,y); labelData.set(x, y, label); } } } }