/** Sets a pixel in the image using a one element int array. */ public final void putPixel(int x, int y, int[] iArray) { putPixelValue(x, y, iArray[0]); }
/** Sets a pixel in the image using a one element int array. */ public final void putPixel(int x, int y, int[] iArray) { putPixelValue(x, y, iArray[0]); }
int[] smooth(int[] a, int n) { FloatProcessor fp = new FloatProcessor(n, 1); for (int i=0; i<n; i++) fp.putPixelValue(i, 0, a[i]); GaussianBlur gb = new GaussianBlur(); gb.blur1Direction(fp, 2.0, 0.01, true, 0); for (int i=0; i<n; i++) a[i] = (int)Math.round(fp.getPixelValue(i, 0)); return a; }
int[] smooth(int[] a, int n) { FloatProcessor fp = new FloatProcessor(n, 1); for (int i=0; i<n; i++) fp.putPixelValue(i, 0, a[i]); GaussianBlur gb = new GaussianBlur(); gb.blur1Direction(fp, 2.0, 0.01, true, 0); for (int i=0; i<n; i++) a[i] = (int)Math.round(fp.getPixelValue(i, 0)); return a; }
public static FloatProcessor convertToFloatProcessor(GrayScaleImage img) { FloatProcessor fp = new FloatProcessor(img.getWidth(), img.getHeight()); for (int r = 0; r < fp.getHeight(); r++) { for (int c = 0; c < fp.getWidth(); c++) { fp.putPixelValue(c, r, img.getValue(r, c)); } } return fp; } }
public ImagePlus imageplus() { final ImageStack imagestack = new ImageStack(dims.x,dims.y); for (int t=0; t<dims.t; ++t) for (int z=0; z<dims.z; ++z) for (int c=0; c<dims.c; ++c) imagestack.addSlice("",elements[c][t][z]); final FloatProcessor minmax = new FloatProcessor(2,1); final double[] evals = extrema(); minmax.putPixelValue(0,0,evals[0]); minmax.putPixelValue(1,0,evals[1]); minmax.resetMinAndMax(); imagestack.update(minmax); final Calibration cal = new Calibration(); cal.pixelWidth = aspects.x; cal.pixelHeight = aspects.y; cal.pixelDepth = aspects.z; cal.frameInterval = aspects.t; ImagePlus imageplus = new ImagePlus(name,imagestack); imageplus.setDimensions(dims.c,dims.z,dims.t); imageplus.setCalibration(cal); return imageplus; }
public ImagePlus imageplus() { final ImageStack imagestack = new ImageStack(dims.x,dims.y); for (int t=0; t<dims.t; ++t) for (int z=0; z<dims.z; ++z) for (int c=0; c<dims.c; ++c) imagestack.addSlice("",elements[c][t][z]); final FloatProcessor minmax = new FloatProcessor(2,1); final double[] evals = extrema(); minmax.putPixelValue(0,0,evals[0]); minmax.putPixelValue(1,0,evals[1]); minmax.resetMinAndMax(); imagestack.update(minmax); final Calibration cal = new Calibration(); cal.pixelWidth = aspects.x; cal.pixelHeight = aspects.y; cal.pixelDepth = aspects.z; cal.frameInterval = aspects.t; ImagePlus imageplus = new ImagePlus(name,imagestack); imageplus.setDimensions(dims.c,dims.z,dims.t); imageplus.setCalibration(cal); return imageplus; }
fp.putPixelValue(i, j, entropy );
fp.putPixelValue(i, j, entropy );
out.putPixelValue(x - startX + Math.round(iI.offset[0]), y - startY + Math.round(iI.offset[1]), Math.max(newValue, oldValue));