@Override public void min( final Positionable min ) { interval.min( min ); }
@Override public void min( final long[] min ) { interval.min( min ); }
@Override public boolean isPresent( final int t ) { return source.min( 3 ) <= t && t <= source.max( 3 ); }
public < T > FragmentProperties( final int index, final RandomAccessibleInterval< LabelingType< T > > labeling ) { super( labeling.numDimensions(), labeling.min( 0 ) ); this.index = index; this.sumPositions = new long[ n ]; }
@SuppressWarnings( "unchecked" ) public StackView( final List< ? extends RandomAccessibleInterval< T > > hyperslices, final StackAccessMode stackAccessMode ) { super( hyperslices.get( 0 ).numDimensions() + 1 ); this.stackAccessMode = stackAccessMode; slices = hyperslices.toArray( new RandomAccessibleInterval[ hyperslices.size() ] ); for ( int d = 0; d < n - 1; ++d ) { min[ d ] = slices[ 0 ].min( d ); max[ d ] = slices[ 0 ].max( d ); } min[ n - 1 ] = 0; max[ n - 1 ] = slices.length - 1; }
@SuppressWarnings( "unchecked" ) public StackView( final List< ? extends RandomAccessibleInterval< T > > hyperslices, final StackAccessMode stackAccessMode ) { super( hyperslices.get( 0 ).numDimensions() + 1 ); this.stackAccessMode = stackAccessMode; slices = hyperslices.toArray( new RandomAccessibleInterval[ hyperslices.size() ] ); for ( int d = 0; d < n - 1; ++d ) { min[ d ] = slices[ 0 ].min( d ); max[ d ] = slices[ 0 ].max( d ); } min[ n - 1 ] = 0; max[ n - 1 ] = slices.length - 1; }
final static protected < T > RandomAccessibleInterval< T > zeroMinN( final RandomAccessibleInterval< T > source ) { final long[] min = new long[ source.numDimensions() ]; final int n = min.length - 1; min[ n ] = source.min( n ); return Views.offset( source, min ); }
final static protected < T > RandomAccessibleInterval< T > zeroMinN( final RandomAccessibleInterval< T > source ) { final long[] min = new long[ source.numDimensions() ]; final int n = min.length - 1; min[ n ] = source.min( n ); return Views.offset( source, min ); }
public SamplingProjector2D( final int dimX, final int dimY, final RandomAccessibleInterval< A > source, final IterableInterval< B > target, final Converter< ProjectedSampler< A >, B > converter, final int projectedDimension ) { super( source.numDimensions() ); this.dimX = dimX; this.dimY = dimY; this.target = target; this.source = source; this.converter = converter; this.projectedDimension = projectedDimension; // set min and max of the projection dim projectedDimMinPos = source.min( projectedDimension ); projectedDimMaxPos = source.max( projectedDimension ); projectionSampler = new IntervalSampler< A >( projectedDimension, projectedDimMinPos, projectedDimMaxPos ); }
public PeriodicLineNeighborhoodCursor( final RandomAccessibleInterval< T > source, final long span, final int[] increments, final PeriodicLineNeighborhoodFactory< T > factory ) { super( source, span, increments, factory, source ); dimensions = new long[ n ]; min = new long[ n ]; max = new long[ n ]; source.dimensions( dimensions ); source.min( min ); source.max( max ); long size = dimensions[ 0 ]; for ( int d = 1; d < n; ++d ) size *= dimensions[ d ]; maxIndex = size - 1; reset(); }
public SamplingProjector2D( final int dimX, final int dimY, final RandomAccessibleInterval< A > source, final IterableInterval< B > target, final Converter< ProjectedSampler< A >, B > converter, final int projectedDimension ) { super( source.numDimensions() ); this.dimX = dimX; this.dimY = dimY; this.target = target; this.source = source; this.converter = converter; this.projectedDimension = projectedDimension; // set min and max of the projection dim projectedDimMinPos = source.min( projectedDimension ); projectedDimMaxPos = source.max( projectedDimension ); projectionSampler = new IntervalSampler< A >( projectedDimension, projectedDimMinPos, projectedDimMaxPos ); }
public HorizontalLineNeighborhoodCursor( final RandomAccessibleInterval< T > source, final long span, final int dim, final boolean skipCenter, final HorizontalLineNeighborhoodFactory< T > factory ) { super( source, span, dim, skipCenter, factory, source ); dimensions = new long[ n ]; min = new long[ n ]; max = new long[ n ]; source.dimensions( dimensions ); source.min( min ); source.max( max ); long size = dimensions[ 0 ]; for ( int d = 1; d < n; ++d ) size *= dimensions[ d ]; maxIndex = size - 1; reset(); }
public PairOfPointsNeighborhoodCursor( final RandomAccessibleInterval< T > source, final long[] offset, final PairOfPointsNeighborhoodFactory< T > factory ) { super( source, offset, factory, source ); dimensions = new long[ n ]; min = new long[ n ]; max = new long[ n ]; source.dimensions( dimensions ); source.min( min ); source.max( max ); long size = dimensions[ 0 ]; for ( int d = 1; d < n; ++d ) size *= dimensions[ d ]; maxIndex = size - 1; reset(); }
public HyperSphereNeighborhoodCursor( final RandomAccessibleInterval< T > source, final long radius, final HyperSphereNeighborhoodFactory< T > factory ) { super( source, radius, factory, source ); dimensions = new long[ n ]; min = new long[ n ]; max = new long[ n ]; source.dimensions( dimensions ); source.min( min ); source.max( max ); long size = dimensions[ 0 ]; for ( int d = 1; d < n; ++d ) size *= dimensions[ d ]; maxIndex = size - 1; reset(); }
/** * Create a variable of type T with value delta by copying and setting a * value from the input {@link RandomAccessibleInterval}. */ private static < T extends RealType< T > > T getDeltaVariable( final RandomAccessibleInterval< T > input, final double delta ) { final RandomAccess< T > a = input.randomAccess(); input.min( a ); final T deltaT = a.get().createVariable(); deltaT.setReal( delta ); return deltaT; }
public BoundaryRandomAccess4( final RandomAccessibleInterval< T > sourceInterval ) { super( sourceInterval.randomAccess() ); n = sourceInterval.numDimensions(); min = new long[ n ]; max = new long[ n ]; sourceInterval.min( min ); sourceInterval.max( max ); type = new BoolType(); }
/** * Create a variable of type T with value delta by copying * and setting a value from the input {@link RandomAccessibleInterval}. */ private static < T extends RealType< T > > T getDeltaVariable( final RandomAccessibleInterval< T > input, double delta ) { RandomAccess< T > a = input.randomAccess(); input.min( a ); T deltaT = a.get().createVariable(); deltaT.setReal( delta ); return deltaT; }
/** * Create an <em>n</em>-dimensional color image from an * (<em>n</em>+1)-dimensional image of {@link UnsignedByteType}. * @param source The last dimension of the image must be the color channel. * {@link Views#stack} could be used to create the source, if * there is a separate image for each color channel. * @param channelOrder Order of the color channels. * @return Color view to the source image that can be used for reading and writing. */ final static public RandomAccessibleInterval< ARGBType > mergeARGB( final RandomAccessibleInterval< UnsignedByteType > source, ColorChannelOrder channelOrder ) { final int channelAxis = source.numDimensions() - 1; if ( source.min( channelAxis ) > 0 || source.max( channelAxis ) < channelOrder.channelCount() - 1 ) throw new IllegalArgumentException(); return Converters.convert( Views.collapse( source ), new CompositeARGBSamplerConverter( channelOrder ) ); }
@Override public void compute(final RandomAccessibleInterval<T> input, final RandomAccessibleInterval<T> output) { // input may potentially be translated final long[] translation = new long[input.numDimensions()]; input.min(translation); final IntervalView<T> tmpInterval = Views.interval(Views.translate( (RandomAccessible<T>) tmpCreator.calculate(input), translation), output); gauss1.compute(input, tmpInterval); gauss2.compute(input, output); // TODO: Match the Subtract Op in initialize() once we have BinaryOp ops().run(Ops.Math.Subtract.class, output, output, tmpInterval); }
@Override public RandomAccessibleInterval< O > compute( IN input, RandomAccessibleInterval< O > output ) { final long[] min = new long[ output.numDimensions() ]; output.min( min ); final long[] max = new long[ output.numDimensions() ]; output.max( max ); for ( int i = 0; i < m_operations.length; i++ ) { max[ max.length - 1 ] = i; min[ min.length - 1 ] = i; m_operations[ i ].compute( input, new ImgView< O >( SubsetViews.iterableSubsetView( output, new FinalInterval( min, max ) ), m_fac ) ); } return output; }