本文整理汇总了Java中net.imglib2.RandomAccessibleInterval.min方法的典型用法代码示例。如果您正苦于以下问题:Java RandomAccessibleInterval.min方法的具体用法?Java RandomAccessibleInterval.min怎么用?Java RandomAccessibleInterval.min使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.RandomAccessibleInterval
的用法示例。
在下文中一共展示了RandomAccessibleInterval.min方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initStore
import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private synchronized void initStore( RandomAccessibleInterval< T > newStore )
{
newStore.dimensions( this.dimensions );
newStore.min( this.min );
newStore.max( this.max );
this.store = newStore;
}
示例2: initStore
import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
private void initStore( RandomAccessibleInterval< T > newStore )
{
newStore.dimensions( this.dimensions );
newStore.min( this.min );
newStore.max( this.max );
this.store = newStore;
}
示例3: BlockedInterval
import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
/**
* @param source
* Source to be wrapped.
* @param stepSize
* Strides for each dimension.
* @param factory
* Factory for extending source.
*/
public BlockedInterval(
RandomAccessibleInterval< T > source,
long[] stepSize,
OutOfBoundsFactory< T, RandomAccessibleInterval< T > > factory )
{
super();
this.stepSize = stepSize;
this.extendedSource = new ExtendedRandomAccessibleInterval< T, RandomAccessibleInterval< T > >( source, factory );
this.nDim = source.numDimensions();
this.max = new long[ nDim ];
this.min = new long[ nDim ];
this.dimensions = new long[ nDim ];
source.min( this.min );
source.max( this.max );
source.dimensions( dimensions );
for ( int d = 0; d < this.nDim; ++d )
{
long val = this.max[ d ] - this.min[ d ];
this.max[ d ] = val / stepSize[ d ] + this.min[ d ];
long dim = this.dimensions[ d ] - this.min[ d ];
this.dimensions[ d ] = dim / stepSize[ d ] + this.min[ d ];
}
}
示例4: writeLevelToHdf5File
import net.imglib2.RandomAccessibleInterval; //导入方法依赖的package包/类
public static void writeLevelToHdf5File(
final ArrayList< RandomAccessibleInterval< LabelMultisetType > > imgs,
final ExportMipmapInfo mipmapInfo,
final int level,
final BlockWriter writer,
final LevelInfoWriter levelInfoWriter )
{
final int n = imgs.get( 0 ).numDimensions();
final int[][] resolutions = mipmapInfo.getExportResolutions();
// Are downsampling factors a multiple of a level that we have
// already written?
int[] factorsToPreviousLevel = null;
int previousLevel = -1;
A: for ( int l = level - 1; l >= 0; --l )
{
final int[] f = new int[ n ];
for ( int d = 0; d < n; ++d )
{
f[ d ] = resolutions[ level ][ d ] / resolutions[ l ][ d ];
if ( f[ d ] * resolutions[ l ][ d ] != resolutions[ level ][ d ] )
continue A;
}
factorsToPreviousLevel = f;
previousLevel = l;
break;
}
final RandomAccessibleInterval< LabelMultisetType > sourceImg = imgs.get( previousLevel );
final long[] factors = Util.int2long( factorsToPreviousLevel );
final long[] dimensions = new long[ n ];
sourceImg.dimensions( dimensions );
for ( int d = 0; d < n; ++d )
dimensions[ d ] = Math.max( dimensions[ d ] / factors[ d ], 1 );
levelInfoWriter.writeLevelInfo( dimensions, Util.int2long( resolutions[ level ] ), Util.int2long( mipmapInfo.getSubdivisions()[ level ] ) );
final long[] minRequiredInput = new long[ n ];
final long[] maxRequiredInput = new long[ n ];
sourceImg.min( minRequiredInput );
for ( int d = 0; d < n; ++d )
maxRequiredInput[ d ] = minRequiredInput[ d ] + dimensions[ d ] * factors[ d ] - 1;
final RandomAccessibleInterval< LabelMultisetType > extendedImg = Views.interval( Views.extendBorder( sourceImg ), new FinalInterval( minRequiredInput, maxRequiredInput ) );
final int[] cellDimensions = mipmapInfo.getSubdivisions()[ level ];
final long[] numCells = new long[ n ];
final int[] borderSize = new int[ n ];
final long[] minCell = new long[ n ];
final long[] maxCell = new long[ n ];
for ( int d = 0; d < n; ++d )
{
numCells[ d ] = ( dimensions[ d ] - 1 ) / cellDimensions[ d ] + 1;
maxCell[ d ] = numCells[ d ] - 1;
borderSize[ d ] = ( int ) ( dimensions[ d ] - ( numCells[ d ] - 1 ) * cellDimensions[ d ] );
}
final LocalizingIntervalIterator i = new LocalizingIntervalIterator( minCell, maxCell );
final long[] currentCellMin = new long[ n ];
final long[] currentCellDim = new long[ n ];
final long[] currentCellPos = new long[ n ];
while ( i.hasNext() )
{
i.fwd();
i.localize( currentCellPos );
for ( int d = 0; d < n; ++d )
{
currentCellMin[ d ] = currentCellPos[ d ] * cellDimensions[ d ];
final boolean isBorderCellInThisDim = ( currentCellPos[ d ] + 1 == numCells[ d ] );
currentCellDim[ d ] = isBorderCellInThisDim ? borderSize[ d ] : cellDimensions[ d ];
}
final VolatileLabelMultisetArray downscaled = Downscale.downscale( extendedImg, factors, currentCellDim, currentCellMin );
writer.writeBlock( downscaled, currentCellMin, currentCellDim );
}
}