public ShortAccessor(ShortProcessor ip) { w = ip.getWidth(); h = ip.getHeight(); pixels = (short[])ip.getPixels(); }
/** Constructs a ShortBlitter from a ShortProcessor. */ public ShortBlitter(ShortProcessor ip) { this.ip = ip; width = ip.getWidth(); height = ip.getHeight(); pixels = (short[])ip.getPixels(); }
/** Constructs a ShortBlitter from a ShortProcessor. */ public ShortBlitter(ShortProcessor ip) { this.ip = ip; width = ip.getWidth(); height = ip.getHeight(); pixels = (short[])ip.getPixels(); }
static public final ShortProcessor median( final ShortProcessor sp, final int nBins, final double min, final double max, final int radius) { final long[] hist = integralHistogram2d((short[])sp.getPixels(), sp.getWidth(), sp.getHeight(), nBins, min, max); final short[] median = median(sp.getWidth(), sp.getHeight(), hist, nBins, min, max, radius); return new ShortProcessor(sp.getWidth(), sp.getHeight(), median, null); }
protected FloatProcessor convertToFloat( final ShortProcessor sp ) { final short[] pixS = (short[]) sp.getPixels(); loader.releaseToFit( pixS.length * 4 ); final float[] pixF = new float[pixS.length]; for ( int i=0; i<pixS.length; ++i) { pixF[i] = pixS[i] & 0xffff; } return new FloatProcessor( sp.getWidth(), sp.getHeight(), pixF ); }
/** A method that circumvents the findMinAndMax when creating a float processor from an existing processor. Ignores color calibrations and does no scaling at all. */ static public final FloatProcessor fastConvertToFloat(final ShortProcessor ip) { final short[] pix = (short[])ip.getPixels(); final float[] data = new float[pix.length]; for (int i=0; i<pix.length; i++) data[i] = pix[i]&0xffff; final FloatProcessor fp = new FloatProcessorT2(ip.getWidth(), ip.getHeight(), data, ip.getColorModel(), ip.getMin(), ip.getMax()); return fp; } /** A method that circumvents the findMinAndMax when creating a float processor from an existing processor. Ignores color calibrations and does no scaling at all. */
max = ip.getMax(); final long[] hist = IntegralHistogram2d.integralHistogram2d((short[])sp.getPixels(), sp.getWidth(), sp.getHeight(), nBins, min, max); final short[] median = IntegralHistogram2d.median(sp.getWidth(), sp.getHeight(), hist, nBins, min, max, this.medianRadius); g.blurGaussian(new ShortProcessor(sp.getWidth(), sp.getHeight(), median, null), this.sigma, this.sigma, 0.02);
final ShortProcessor target ) final int w = target.getWidth() - 1; final int h = target.getHeight() - 1; final ArrayList< PointMatch > pm = m.getAV().get( ai );
ImageProcessor ip2 = null; if (interpolationMethod==BICUBIC) ip2 = new ShortProcessor(getWidth(), getHeight(), pixels2, null); double centerX = roiX + (roiWidth-1)/2.0; double centerY = roiY + (roiHeight-1)/2.0;
ImageProcessor ip2 = null; if (interpolationMethod==BICUBIC) ip2 = new ShortProcessor(getWidth(), getHeight(), pixels2, null); double centerX = roiX + (roiWidth-1)/2.0; double centerY = roiY + (roiHeight-1)/2.0;
final static public ShortProcessor downsampleShortProcessor( final ShortProcessor a ) final int wa = a.getWidth(); final int ha = a.getHeight(); final int wa2 = wa + wa;
final ByteProcessor alphaTarget = makeAlphaMask ? new ByteProcessor( sp.getWidth(), sp.getHeight() ) : null;
ImageProcessor ip2 = null; if (interpolationMethod==BICUBIC) ip2 = new ShortProcessor(getWidth(), getHeight(), pixels2, null); boolean checkCoordinates = (xScale < 1.0) || (yScale < 1.0); short min2 = (short)getMin();
ImageProcessor ip2 = null; if (interpolationMethod==BICUBIC) ip2 = new ShortProcessor(getWidth(), getHeight(), pixels2, null); boolean checkCoordinates = (xScale < 1.0) || (yScale < 1.0); short min2 = (short)getMin();
final int wa = a.getWidth(); final int ha = a.getHeight(); final int wa2 = wa + wa;
short[] pix = (short[]) bp.getPixels(); for (int i=0; i<pix.length; ++i) pix[i] *= 255; // expand to 16-bit range: when doing so, the scaleAreaAverage fails long[] lii = longIntegralImage(pix, bp.getWidth(), bp.getHeight()); byte[] scaled = scaleAreaAverage(lii, bp.getWidth()+1, bp.getHeight()+1, bp.getWidth()/4, bp.getHeight()/4); final float[] fpix = new float[lii.length]; for (int i=0; i<fpix.length; ++i) fpix[i] = (float)lii[i]; new ij.ImagePlus("integral long of short", new ij.process.FloatProcessor(bp.getWidth()+1, bp.getHeight()+1, fpix, null)).show(); new ij.ImagePlus("scaled long of short", new ij.process.ByteProcessor(bp.getWidth()/4, bp.getHeight()/4, scaled, null)).show();
rs = Downsampler.downsampleShort(sp); sp = rs.a; p[i++] = new ImageBytes(new byte[][]{rs.b}, sp.getWidth(), sp.getHeight()); final Pair< ShortProcessor, byte[] > rs = Downsampler.downsampleShort(sp); sp = rs.a; p[i] = new ImageBytes(new byte[][]{rs.b, (byte[])masks[i].getPixels()}, sp.getWidth(), sp.getHeight()); ++i;