本文整理了Java中net.imglib2.view.Views.interval()
方法的一些代码示例,展示了Views.interval()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Views.interval()
方法的具体详情如下:
包路径:net.imglib2.view.Views
类名称:Views
方法名:interval
[英]Define an interval on a RandomAccessible. It is the callers responsibility to ensure that the source RandomAccessible is defined in the specified interval.
[中]在随机变量上定义一个间隔。调用者有责任确保在指定的时间间隔内定义源。
代码示例来源:origin: imglib/imglib2
@Deprecated
public static < T > RandomAccessibleInterval< T > constantRandomAccessibleInterval( final T constant, final int numDimensions, final Interval interval )
{
return Views.interval( constantRandomAccessible( constant, numDimensions ), interval );
}
代码示例来源:origin: net.imglib2/imglib2
@SuppressWarnings( "unchecked" )
@Override
public Cursor< T > localizingCursor( final Interval interval )
{
if ( this.sourceInterval instanceof SubIntervalIterable )
return ( ( SubIntervalIterable< T > ) this.sourceInterval ).localizingCursor( interval );
else
return Views.interval( this.sourceInterval, interval )
.localizingCursor();
}
代码示例来源:origin: sc.fiji/bigdataviewer-core
@Override
public RandomAccessibleInterval< T > getSource( final int t, final int level )
{
return Views.interval( Views.raster( accessible ), getInterval( t, level ) );
}
代码示例来源:origin: net.imglib2/imglib2-roi
@SuppressWarnings( "unchecked" )
@Override
public Cursor< LabelingType< L > > cursor( final Interval interval )
{
if ( this.sourceInterval instanceof SubIntervalIterable )
return ( ( SubIntervalIterable< LabelingType< L > > ) this.sourceInterval ).cursor( interval );
else
return Views.interval( this.sourceInterval, interval ).cursor();
}
代码示例来源:origin: net.imglib2/imglib2-roi
@SuppressWarnings( "unchecked" )
@Override
public Cursor< LabelingType< L > > localizingCursor( final Interval interval )
{
if ( this.sourceInterval instanceof SubIntervalIterable )
return ( ( SubIntervalIterable< LabelingType< L > > ) this.sourceInterval ).localizingCursor( interval );
else
return Views.interval( this.sourceInterval, interval ).localizingCursor();
}
}
代码示例来源:origin: net.imglib2/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a periodic out-of-bounds strategy.
*
* @param source
* the interval to expand.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by border.
*/
public static < T > IntervalView< T > expandPeriodic( final RandomAccessibleInterval< T > source, final long... border )
{
return interval( extendPeriodic( source ), Intervals.expand( source, border ) );
}
代码示例来源:origin: imagej/imagej-ops
private Cursor<T> getCube(
final ExtendedRandomAccessibleInterval<T, RandomAccessibleInterval<T>> extended,
final int cursorX, final int cursorY, final int cursorZ)
{
return Views.flatIterable(Views.interval(extended, new FinalInterval(
new long[] { cursorX, cursorY, cursorZ }, new long[] { cursorX + 1,
cursorY + 1, cursorZ + 1 }))).cursor();
}
代码示例来源:origin: net.imglib2/imglib2-roi
@SuppressWarnings( "unchecked" )
@Override
public Cursor< LabelingType< T > > localizingCursor( final Interval interval )
{
final Cursor< I > c;
if ( subIterable )
c = ( ( SubIntervalIterable< I > ) indexIterable ).localizingCursor( interval );
else
c = Views.interval( indexAccessible, interval ).localizingCursor();
return new LabelingConvertedCursor( c );
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
public RandomAccessibleInterval< FloatType > getRandomAccessibleInterval( final int numPoints, final double power )
{
final KNearestNeighborSearch< FloatType > search = new KNearestNeighborSearchOnKDTree<>( new KDTree<>( qualityList ), numPoints );
final RealRandomAccessible< FloatType > realRandomAccessible = Views.interpolate( search, new InverseDistanceWeightingInterpolatorFactory< FloatType >( power ) );
final RandomAccessible< FloatType > randomAccessible = Views.raster( realRandomAccessible );
final RandomAccessibleInterval< FloatType > rai = Views.interval( randomAccessible, interval );
return Views.interval( Views.extendZero( rai ), interval );
}
代码示例来源:origin: net.imagej/imagej-common
private static <T> IterableInterval<T> iterableInterval(
final RealRandomAccessibleRealInterval<T> realInterval)
{
final RandomAccessibleOnRealRandomAccessible<T> raster =
Views.raster(realInterval);
final IntervalView<T> interval =
Views.interval(raster, findMin(realInterval), findMax(realInterval));
return Views.iterable(interval);
}
代码示例来源:origin: imagej/imagej-ops
@Override
public void compute(final RandomAccessibleInterval<T> in1,
final List<Shape> in2, final IterableInterval<T> out)
{
final Img<T> buffer = imgCreator.calculate(out);
dilateComputer.compute(in1, in2, buffer);
erodeComputer.compute(Views.interval(Views.extendValue(buffer, maxVal),
out), in2, out);
}
}
代码示例来源:origin: sc.fiji/bigdataviewer-core
/**
* For images that are missing in the hdf5, a constant image is created. If
* the dimension of the missing image is known (see
* {@link #getDimsAndExistence(ViewLevelId)}) then use that. Otherwise
* create a 1x1x1 image.
*/
protected < T > RandomAccessibleInterval< T > getMissingDataImage( final ViewLevelId id, final T constant )
{
final long[] d = getDimsAndExistence( id ).getDimensions();
return Views.interval( new ConstantRandomAccessible<>( constant, 3 ), new FinalInterval( d ) );
}
代码示例来源:origin: net.imglib2/imglib2-script
private Paste(final RI source, final IterableInterval<Y> target, final long[] offset) {
this.target = target;
this.tc = target.cursor();
this.min = new long[source.numDimensions()];
this.max = new long[source.numDimensions()];
for (int i=0; i<this.min.length; ++i) {
this.min[i] = (long) Math.min(offset[i], target.realMax(i));
this.max[i] = (long) Math.min(offset[i] + source.realMax(i), target.realMax(i));
}
RandomAccessibleInterval<T> view = Views.interval(source, min, max);
this.copier = source.iterationOrder().equals(target.iterationOrder()) ? new CompatibleCopier(view) : new RandomAccessCopier(view);
}
代码示例来源:origin: imagej/imagej-ops
@Override
public RandomAccessibleInterval<T> calculate(RandomAccessibleInterval<T> input) {
final long[] newDims = Intervals.dimensionsAsLongArray(in());
for (int i = 0; i < Math.min(scaleFactors.length, in().numDimensions()); i++) {
newDims[i] = Math.round(in().dimension(i) * scaleFactors[i]);
}
IntervalView<T> interval = Views.interval(Views.raster(RealViews.affineReal(
Views.interpolate(Views.extendMirrorSingle(input), interpolator),
new Scale(scaleFactors))), new FinalInterval(newDims));
return interval;
}
代码示例来源:origin: imglib/imglib2
@Test
public void testJumpFwdShifted()
{
Cursor< IntType > cursor = Views.interval( img, intervalShifted ).cursor();
testCursorJumpFwd( cursor, intervalShifted );
}
代码示例来源:origin: imglib/imglib2
@Test
public void testLocalizingJumpFwdShifted()
{
Cursor< IntType > cursor = Views.interval( img, intervalShifted ).localizingCursor();
testCursorJumpFwd( cursor, intervalShifted );
}
代码示例来源:origin: imglib/imglib2
@Test
public void testLocalizingIterationSinglePlane()
{
Cursor< IntType > cursor = Views.interval( img, intervalSinglePlaneFull ).localizingCursor();
testCursorIteration( cursor, intervalSinglePlaneFull );
}
}
代码示例来源:origin: imglib/imglib2
@Test
public void testIterationIntervalLine()
{
Cursor< IntType > cursor = Views.interval( img, intervalLine ).cursor();
testCursorIteration( cursor, intervalLine );
}
代码示例来源:origin: imglib/imglib2
@Test
public void testIterationSinglePlaneShifted()
{
Cursor< IntType > cursor = Views.interval( img, intervalSinglePlaneShifted ).cursor();
testCursorIteration( cursor, intervalSinglePlaneShifted );
}
代码示例来源:origin: net.imglib2/imglib2-script
public <R extends RealType<R>> Paste(
final RandomAccessibleInterval<T> source,
final IterableRealInterval<R> target,
final long[] offset) throws Exception {
this.background = AlgorithmUtil.type(source, 0);
this.a = new ImageFunction<T>(new RandomAccessibleIntervalImgProxy<T>(
Views.interval(
Views.offset(Views.extendValue(source, background), offset),
new FinalInterval(Util.intervalDimensions(target)))));
this.b = new ImageFunction<R>(target);
}
内容来源于网络,如有侵权,请联系作者删除!