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

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

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

Intervals.createMinMax介绍

[英]Create a FinalInterval from a parameter list comprising minimum and maximum coordinates. For example, to create a 2D interval from (10, 10) to (20, 40) use createMinMax( 10, 10, 20, 40 ).
[中]

代码示例

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

private Interval createInterval()
  {
    final long[] minmax = new long[ 2 * position.length ];
    for ( int i = 0; i < position.length; i++ )
    {
      minmax[ i ] = position[ i ] - radius;
    }
    for ( int i = position.length; i < minmax.length; i++ )
    {
      minmax[ i ] = position[ i - position.length ] + radius;
    }
    return Intervals.createMinMax( minmax );
  }
}

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

private Interval createInterval()
  {
    final long[] minsize = new long[ 2 * position.length ];
    for ( int i = 0; i < position.length; i++ )
    {
      if ( i == dim )
      {
        minsize[ i ] = position[ i ] - span;
      }
      else
      {
        minsize[ i ] = position[ i ];
      }
    }
    for ( int i = position.length; i < minsize.length; i++ )
    {
      if ( i - position.length == dim )
      {
        minsize[ i ] = position[ i - position.length ] + span;
      }
      else
      {
        minsize[ i ] = position[ i - position.length ];
      }
    }
    return Intervals.createMinMax( minsize );
  }
}

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

private Interval createInterval()
  {
    final long[] minmax = new long[ 2 * position.length ];
    for ( int i = 0; i < position.length; i++ )
    {
      minmax[ i ] = position[ i ] - span * Math.abs( increments[ i ] );
    }
    for ( int i = position.length; i < minmax.length; i++ )
    {
      minmax[ i ] = position[ i - position.length ] + span * Math.abs( increments[ i - position.length ] );
    }
    return Intervals.createMinMax( minmax );
  }
}

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

@Override
public Interval getStructuringElementBoundingBox()
{
  final long[] minmax = new long[ ndims * 2 ];
  for ( int d = 0; d < ndims; d++ )
  {
    minmax[ d ] = Math.min( position[ d ], position[ d ] + offset[ d ] );
  }
  for ( int d = ndims; d < 2 * ndims; d++ )
  {
    final int sd = d - ndims;
    minmax[ d ] = Math.max( position[ sd ], position[ sd ] + offset[ sd ] );
  }
  return Intervals.createMinMax( minmax );
}

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

@Test( expected = AssertionError.class )
public void testAssertIntervalsEquals_Fail()
{
  Interval a = Intervals.createMinMax( 1, 2, 3, 4 );
  Interval b = Intervals.createMinMax( 1, 3, 3, 4 );
  ImgLib2Assert.assertIntervalEquals( a, b );
}

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

@Test
public void testAssertIntervalsEquals()
{
  Interval a = Intervals.createMinMax( 1, 2, 3, 4 );
  Interval b = Intervals.createMinMax( 1, 2, 3, 4 );
  ImgLib2Assert.assertIntervalEquals( a, b );
}

代码示例来源:origin: net.preibisch/multiview-simulation

public static void main(String[] args)
  {
    SimulateBeads2 sb = new SimulateBeads2( 2000, new double[]{1, 1, 3}, Intervals.createMinMax( 0,0,0, 512, 512, 200 ), Intervals.createMinMax( 0,0,0, 512, 512, 200 ) );
    sb.addTile( 0, new double[]{0,0,0} );
    sb.addTile( 1, new double[]{10,0,0} );
    ImageJFunctions.show( sb.getImg( 0, 0, 0, 0, 0 ) );
    ImageJFunctions.show( sb.getImg( 0, 0, 0, 1, 0 ) );
  }
}

代码示例来源:origin: net.preibisch/multiview-simulation

params.overlaps = new double[] {overlap, overlap, overlap};
params.nSteps = new int[] {numTilesX, numTilesY, 1};
List< AffineTransform3D > generateRegularGrid = RegularTranformHelpers.generateRegularGrid( params, Intervals.createMinMax( vpMinMax ) );
return createSpimData( numPoints, sigmas, Intervals.createMinMax( simMinMax ), Intervals.createMinMax( vpMinMax ), rotAxis, angles, channelShifts, illumShifts, timeShifts, tileShifts, relError, center );

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

@Test
public void testIntervalToString()
{
  Interval interval = Intervals.createMinMax( 1, 2, 3, 4 );
  String restult = ImgLib2Assert.intervalToString( interval );
  assertEquals( "{min=[1, 2], max=[3, 4]}", restult );
}

代码示例来源:origin: sc.fiji/bigdataviewer-vistools

public RandomAccessibleSource4D(
    final RandomAccessible< T > img,
    final Interval interval,
    final T type,
    final AffineTransform3D sourceTransform,
    final String name )
{
  super( type, name );
  this.source = img;
  this.interval = interval;
  this.timeSliceInterval = Intervals.createMinMax(
      interval.min( 0 ), interval.min( 1 ), interval.min( 2 ),
      interval.max( 0 ), interval.max( 1 ), interval.max( 2 ) );
  this.sourceTransform = sourceTransform;
  currentInterpolatedSources = new RealRandomAccessible[ Interpolation.values().length ];
  loadTimepoint( 0 );
}

代码示例来源:origin: net.preibisch/multiview-reconstruction

final Interval initialInterval = Intervals.createMinMax( min[ 0 ], min[ 1 ], min[ 2 ], max[ 0 ], max[ 1 ], max[ 2 ] ); // the initially selected bounding box
final Interval rangeInterval = Intervals.createMinMax(
    maxBB.getMin()[ 0 ], maxBB.getMin()[ 1 ], maxBB.getMin()[ 2 ],
    maxBB.getMax()[ 0 ], maxBB.getMax()[ 1 ], maxBB.getMax()[ 2 ] ); // the range (bounding box of possible bounding boxes)

相关文章