gauss( sigma, source, target, service ); service.shutdown();
gauss( sigma, source, target, service ); service.shutdown();
for ( int d = 0; d < n; ++d ) s[ d ] = sigma; gauss( s, source, target );
for ( int d = 0; d < n; ++d ) s[ d ] = sigma; gauss( s, source, target );
@Override public final < R extends RealType< R > > Img< FloatType > evaluate( final Img< R > img, final R alpha ) throws ParseException { RandomAccessibleInterval< FloatType > fimg = ImgLibUtils.copyToFloatTypeImage( img ); try { Gauss3.gauss( alpha.getRealDouble(), Views.extendZero( fimg ), fimg ); } catch ( IncompatibleTypeException e ) { throw new RuntimeException( e ); } return ( Img< FloatType > ) fimg; }
public static double[] computeCenter( final Img< FloatType > i, final double threshold ) throws IncompatibleTypeException { final Img<FloatType> copy = i.copy(); Gauss3.gauss( 2, Views.extendMirrorSingle( copy ), copy ); return centerofmass( copy, threshold ); }
Gauss3.gauss( Util.getArrayFromValue( sigma, psi.numDimensions() ), Views.extendMirrorSingle( psi ), psi, service );
protected Img< FloatType > computeGaussianConvolution( final double[] sigma ) { final FloatType type = new FloatType(); Img< FloatType > target = null; try { target = this.factory.imgFactory( type ).create( image, type ); Gauss3.gauss( sigma, Views.extend( image, outOfBoundsFactory ), target ); } catch ( final IncompatibleTypeException e ) { e.printStackTrace(); } return target; }
public ArrayList< ImagePlus > call() { // Get channel(s) to process ImagePlus[] channels = extractChannels(originalImage); ArrayList<ImagePlus>[] results = new ArrayList[ channels.length ]; for(int ch=0; ch < channels.length; ch++) { results[ ch ] = new ArrayList<ImagePlus>(); final ImagePlus im = channels [ ch ].duplicate(); final Img<FloatType> image2 = ImagePlusAdapter.wrap( im ); // first extend the image with mirror RandomAccessible< FloatType > mirrorImg = Views.extendMirrorSingle( image2 ); // adjust sigma based on voxel size final double[] isoSigma = new double[ mirrorImg.numDimensions() ]; for ( int d = 0; d < isoSigma.length; ++d ) isoSigma[ d ] = sigma * scaleFactor[ d ]; try { Gauss3.gauss( isoSigma, mirrorImg, image2 ); } catch (IncompatibleTypeException e) { IJ.log( "Error when calculating Gaussian feature." ); e.printStackTrace(); return null; } final ImagePlus ip = ImageJFunctions.wrapFloat( image2, availableFeatures[ GAUSSIAN ] +"_" + sigma ); results[ch].add( ip ); } return mergeResultChannels(results); } };
public ArrayList< ImagePlus > call() { // Get channel(s) to process ImagePlus[] channels = extractChannels(originalImage); ArrayList<ImagePlus>[] results = new ArrayList[ channels.length ]; for(int ch=0; ch < channels.length; ch++) { results[ ch ] = new ArrayList<ImagePlus>(); final ImagePlus im = channels [ ch ].duplicate(); final Img<FloatType> image2 = ImagePlusAdapter.wrap( im ); // first extend the image with mirror RandomAccessible< FloatType > mirrorImg = Views.extendMirrorSingle( image2 ); // adjust sigma based on voxel size final double[] isoSigma = new double[ mirrorImg.numDimensions() ]; for ( int d = 0; d < isoSigma.length; ++d ) isoSigma[ d ] = sigma * scaleFactor[ d ]; try { Gauss3.gauss( isoSigma, mirrorImg, image2 ); } catch (IncompatibleTypeException e) { IJ.log( "Error when calculating Gaussian feature." ); e.printStackTrace(); return null; } final ImagePlus ip = ImageJFunctions.wrapFloat( image2, availableFeatures[ GAUSSIAN ] +"_" + sigma ); results[ch].add( ip ); } return mergeResultChannels(results); } };
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( 2 ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( img.numDimensions() ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
Gauss3.gauss( rad / Math.sqrt( img.numDimensions() ), source, img ); final ImgPlus< UnsignedShortType > imgplus = new ImgPlus< >( img );
/** Tests the Gaussian. */ @Test public void gaussRegressionTest() { final Img<ByteType> in = generateByteArrayTestImg(true, new long[] { 10, 10 }); final Img<ByteType> out1 = ops.create().img(in, Util.getTypeFromInterval(in)); final double sigma = 5; final Img<ByteType> out2 = ops.create().img(in, Util.getTypeFromInterval(in)); ops.run(GaussRAISingleSigma.class, out1, in, sigma); try { Gauss3.gauss(sigma, Views.extendMirrorSingle(in), out2); } catch (IncompatibleTypeException e) { throw new RuntimeException(e); } // compare outputs final Cursor<ByteType> c1 = out1.cursor(); final Cursor<ByteType> c2 = out2.cursor(); while (c1.hasNext()) { org.junit.Assert.assertEquals(c1.next().getRealDouble(), c2.next() .getRealDouble(), 0); } }