protected OutOfBoundsRandomValue( final OutOfBoundsRandomValue< T > outOfBounds ) { super( outOfBounds ); this.value = outOfBounds.value.copy(); this.minValue = outOfBounds.minValue; this.maxValue = outOfBounds.maxValue; this.range = outOfBounds.range; this.rnd = new Random(); }
protected OutOfBoundsRandomValue( final OutOfBoundsRandomValue< T > outOfBounds ) { super( outOfBounds ); this.value = outOfBounds.value.copy(); this.minValue = outOfBounds.minValue; this.maxValue = outOfBounds.maxValue; this.range = outOfBounds.range; this.rnd = new Random(); }
@Override public OutOfBoundsRandomValue< T > create( final F f ) { return new OutOfBoundsRandomValue< T >( f, value.copy(), rnd, min, max ); } }
@Override public < O extends RealType< O > > NumericSource< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new NumericSource< O >( tmp.copy(), this.number ); } }
@Override public OutOfBoundsRandomValue< T > create( final F f ) { return new OutOfBoundsRandomValue< T >( f, value.copy(), rnd, min, max ); } }
@Override public VolatileRealType< T > copy() { return new VolatileRealType< T >( t.copy(), valid ); } }
@Override public UnaryOperation< RandomAccessibleInterval<T>, Labeling< Integer >> copy() { return new CCA< T >( m_structuringElement.clone(), m_background.copy(), m_synchronizer ); }
@Override public < O extends RealType< O > > Addition< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new Addition< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
@Override public < O extends RealType< O > > Subtraction< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new Subtraction< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
@Override public < O extends RealType< O > > Multiplication< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new Multiplication< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
@Override public < O extends RealType< O > > NotEquality< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new NotEquality< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
@Override public < O extends RealType< O > > IsGreaterThan< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new IsGreaterThan< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
@Override public < O extends RealType< O > > Division< O > reInit( final O tmp, final Map< String, O > bindings, final Converter< RealType< ? >, O > converter, final Map< Variable< O >, OFunction< O > > imgSources ) { return new Division< O >( tmp.copy(), this.a.reInit( tmp, bindings, converter, imgSources ), this.b.reInit( tmp, bindings, converter, imgSources ) ); } }
private < T extends RealType< T > > T minValue( final T one ) { final T minValue = one.copy(); minValue.mul( one.getMinValue() ); return minValue; }
public LanczosInterpolator( final LanczosInterpolator< T > interpolator ) { super( interpolator.target.copyRandomAccess(), interpolator.offset ); this.alpha = interpolator.alpha; lut = interpolator.lut.clone(); products = interpolator.products.clone(); this.size = interpolator.size.clone(); this.max = interpolator.max.clone(); this.clip = interpolator.clip; this.interpolatedValue = interpolator.interpolatedValue.copy(); this.minValue = interpolator.minValue; this.maxValue = interpolator.maxValue; }
public LanczosInterpolator( final LanczosInterpolator< T > interpolator ) { super( interpolator.target.copyRandomAccess(), interpolator.offset ); this.alpha = interpolator.alpha; lut = interpolator.lut.clone(); products = interpolator.products.clone(); this.size = interpolator.size.clone(); this.max = interpolator.max.clone(); this.clip = interpolator.clip; this.interpolatedValue = interpolator.interpolatedValue.copy(); this.minValue = interpolator.minValue; this.maxValue = interpolator.maxValue; }
@Override public int compare(final Long o1, final Long o2) { IntervalIndexer.indexToPosition(o1, in, raIn); final T value = raIn.get().copy(); IntervalIndexer.indexToPosition(o2, in, raIn); return value.compareTo(raIn.get()); } });
private < T extends RealType< T > > T maxValue( final T one ) { if ( one instanceof Unsigned128BitType ) // NB: Max value for Unsigned128BitType, is not returned with required precision by one.getMaxValue(). return ( T ) new Unsigned128BitType( 0xffffffffffffffffL, 0xffffffffffffffffL ); final T maxValue = one.copy(); maxValue.mul( one.getMaxValue() ); return maxValue; }
private <T extends RealType<T>> void assertDefaultInvert(final Img<T> in, final Img<T> out) { final T type = in.firstElement(); final T min = type.copy(); min.setReal(type.getMinValue()); final T max = type.copy(); max.setReal(type.getMaxValue()); final Op op = ops.op(Ops.Image.Invert.class, out, in); assertSame(InvertII.class, op.getClass()); op.run(); defaultCompare(in, out, min, max); }