net.imglib2.util.Intervals.expand()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中net.imglib2.util.Intervals.expand()方法的一些代码示例,展示了Intervals.expand()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intervals.expand()方法的具体详情如下:
包路径:net.imglib2.util.Intervals
类名称:Intervals
方法名:expand

Intervals.expand介绍

[英]Grow/shrink an interval in all dimensions. Create a FinalInterval , which is the input interval plus border pixels on every side, in every dimension.
[中]在所有维度中增加/缩小间隔。创建一个FinalInterval,它是每个维度的输入间隔加上每边的边界像素。

代码示例

代码示例来源:origin: imagej/imagej-ops

private static Interval slightlyEnlarge(RealInterval realInterval,
  long border)
{
  return Intervals.expand(Intervals.smallestContainingInterval(realInterval),
    border);
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Grow/shrink an interval in all dimensions.
 * 
 * Create a {@link FinalInterval}, which is the input interval plus border
 * pixels on every side, in every dimension.
 * 
 * @param interval
 *            the input interval
 * @param border
 *            how many pixels to add on every side
 * @return expanded interval
 */
public static FinalInterval expand( final Interval interval, final long ... border )
{
  return expand(interval, new FinalDimensions( border ));
}

代码示例来源: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: imglib/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: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are repeated.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with the border value.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandBorder( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendBorder( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with the zero-element of that data type.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T extends NumericType< T > > IntervalView< T > expandZero( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendZero( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are repeated.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorDouble( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorDouble( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with the border value.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandBorder( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendBorder( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with the zero-element of that data type.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T extends NumericType< T > > IntervalView< T > expandZero( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendZero( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are not
 * repeated. Note that this requires that all dimensions of the source (F
 * source) must be &gt; 1.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorSingle( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorSingle( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled as specified by {@link OutOfBoundsFactory} oob.
 *
 * @param source
 *            the interval to expand.
 * @param oob
 *            the out-of-bounds strategy.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by oob and border.
 */
public static < T, F extends RandomAccessibleInterval< T > > IntervalView< T > expand( final F source, final OutOfBoundsFactory< T, ? super F > oob, final long... border )
{
  return Views.interval( Views.extend( source, oob ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * 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 t
 *            Constant extension of source.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by t and border.
 */
public static < T extends Type< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final T t, final long... border )
{
  return interval( extendValue( source, t ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled as specified by {@link OutOfBoundsFactory} oob.
 *
 * @param source
 *            the interval to expand.
 * @param oob
 *            the out-of-bounds strategy.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by oob and border.
 */
public static < T, F extends RandomAccessibleInterval< T > > IntervalView< T > expand( final F source, final OutOfBoundsFactory< T, ? super F > oob, final long... border )
{
  return Views.interval( Views.extend( source, oob ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with a random-value out-of-bounds strategy.
 *
 * @param source
 *            the interval to expand.
 * @param min
 *            the minimal random value
 * @param max
 *            the maximal random value
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by min, max, and border.
 */
public static < T extends RealType< T > > IntervalView< T > expandRandom( final RandomAccessibleInterval< T > source, final double min, final double max, final long... border )
{
  return interval( extendRandom( source, min, max ), Intervals.expand( source, border ) );
}

代码示例来源:origin: net.imglib2/imglib2

/**
 * 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 t
 *            Constant extension of source.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by t and border.
 */
public static < T extends Type< T > > IntervalView< T > expandValue( final RandomAccessibleInterval< T > source, final T t, final long... border )
{
  return interval( extendValue( source, t ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. Out of bounds
 * pixels will be sampled by mirroring source. Boundary pixels are not
 * repeated. Note that this requires that all dimensions of the source (F
 * source) must be &gt; 1.
 *
 * @param source
 *            the interval to expand.
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by border.
 */
public static < T > IntervalView< T > expandMirrorSingle( final RandomAccessibleInterval< T > source, final long... border )
{
  return interval( extendMirrorSingle( source ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

/**
 * Expand a RandomAccessibleInterval as specified by border. source will be
 * extended with a random-value out-of-bounds strategy.
 *
 * @param source
 *            the interval to expand.
 * @param min
 *            the minimal random value
 * @param max
 *            the maximal random value
 * @return Expansion of the {@link RandomAccessibleInterval} source as
 *         specified by min, max, and border.
 */
public static < T extends RealType< T > > IntervalView< T > expandRandom( final RandomAccessibleInterval< T > source, final double min, final double max, final long... border )
{
  return interval( extendRandom( source, min, max ), Intervals.expand( source, border ) );
}

代码示例来源:origin: imglib/imglib2

private static void testExtendBoolean(
    final long[] dims,
    final boolean insideValue,
    final boolean extension ) {
  final RandomAccessibleInterval< BitType > rai = ArrayImgs.bits( dims );
  Views.iterable( rai ).forEach( px -> px.set( insideValue ) );
  testValueExtended(
      Views.extendValue( rai, extension ),
      rai,
      Intervals.expand( rai, 1 ),
      new BitType( insideValue ),
      new BitType( extension ) );
}

代码示例来源:origin: imglib/imglib2

private static void testExpandBoolean(
    final long[] dims,
    final boolean insideValue,
    final boolean extension,
    final long... border) {
  final RandomAccessibleInterval<BitType> rai = ArrayImgs.bits( dims );
  Views.iterable( rai ).forEach( px -> px.set( insideValue ) );
  testValueExtended(
      Views.expandValue( rai, extension, border ),
      rai,
      Intervals.expand( rai, border ),
      new BitType( insideValue ),
      new BitType( extension ) );
}

相关文章