/** * Expand a RandomAccessibleInterval as specified by border. source will be * extended with a constant value specified by the caller. * * @param source * the interval to expand. * @param value * Constant extension of source. * @return Expansion of the {@link RandomAccessibleInterval} source as * specified by t and border. */ public static < T extends BooleanType< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final boolean value, final long... border ) { final T extension = Util.getTypeFromInterval( source ).createVariable(); extension.set( value ); return Views.expandValue( source, extension, border ); }
public < T extends BooleanType<T> >BoolType( final T type ) { this( type.get() ); }
@Override public B get() { type.set( contains.test( this ) ); return type; }
@Override public T createOutput(final T in1, final T in2) { return in1.createVariable(); }
List<RealPoint> p = new ArrayList<>(); final B var = Util.getTypeFromInterval(input).createVariable(); if (cInput.next().get()) { raInput.setPosition(cInput); raInput.localize(startPos); if (cNeigh.next().get()) {
protected MaskPredicateRandomAccess( final MaskPredicateRandomAccess< B > cra ) { super( cra ); contains = cra.contains; type = cra.type.copy(); }
private static <B extends BooleanType<B>> long getAtLocation(final RandomAccess<B> access, final long x, final long y, final long z) { access.setPosition(x, 0); access.setPosition(y, 1); access.setPosition(z, 2); return (long) access.get().getRealDouble(); } }
@Override public void mutate(final T arg) { arg.not(); } }
protected < T extends BooleanType< T > > void calculate( final RandomAccessible< T > source, final IterableInterval< T > target ) { final RandomAccessible< Neighborhood< T > > accessible = shape.neighborhoodsRandomAccessible( source ); final RandomAccess< Neighborhood< T > > randomAccess = accessible.randomAccess( target ); final Cursor< T > cursorTarget = target.cursor(); final boolean[] table = getTable(); while ( cursorTarget.hasNext() ) { final T targetVal = cursorTarget.next(); randomAccess.setPosition( cursorTarget ); final Neighborhood< T > neighborhood = randomAccess.get(); final Cursor< T > nc = neighborhood.cursor(); int idx = 0; // Assume that the neighborhood obtained is of FlatIterationOrder, // and assemble the index using bitwise operations. while ( nc.hasNext() ) { idx <<= 1; idx |= nc.next().get() ? 1 : 0; } targetVal.set( table[ idx ] ); } }
@Override public void compute(final I in1, final I in2, final O out) { out.set(in1.compareTo(in2) > 0); } }
@Override public T createOutput(final T in1, final T in2) { return in1.createVariable(); }
protected MaskPredicateRealRandomAccess( final MaskPredicateRealRandomAccess< B > cra ) { super( cra.numDimensions() ); contains = cra.contains; type = cra.type.copy(); }
private static <B extends BooleanType<B>> int getAtLocation(final Traverser<B> traverser, final long x, final long y, final long z) { traverser.access.setPosition(x, 0); traverser.access.setPosition(y, 1); traverser.access.setPosition(z, 2); final double realDouble = traverser.access.get().getRealDouble(); return (int) realDouble; } //endregion
public < T extends BooleanType<T> >BoolType( final T type ) { this( type.get() ); }