本文整理汇总了Java中ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures类的典型用法代码示例。如果您正苦于以下问题:Java HDF5IntStorageFeatures类的具体用法?Java HDF5IntStorageFeatures怎么用?Java HDF5IntStorageFeatures使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HDF5IntStorageFeatures类属于ch.systemsx.cisd.hdf5包,在下文中一共展示了HDF5IntStorageFeatures类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUnsignedByte
import ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures; //导入依赖的package包/类
/**
* Save a {@link RandomAccessibleInterval} of {@link LongType} into an HDF5
* uint8 dataset.
*
* @param source source
* @param dimensions dimensions of the dataset if created new
* @param writer
* @param dataset
* @param cellDimensions
*/
static public void createUnsignedByte(
final IHDF5Writer writer,
final String dataset,
final Dimensions datasetDimensions,
final int[] cellDimensions )
{
final IHDF5ByteWriter uint8Writer = writer.uint8();
if ( writer.exists( dataset ) )
writer.delete( dataset );
uint8Writer.createMDArray(
dataset,
reorder( Intervals.dimensionsAsLongArray( datasetDimensions ) ),
reorder( cellDimensions ),
HDF5IntStorageFeatures.INT_AUTO_SCALING_DEFLATE );
}
示例2: createUnsignedLong
import ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures; //导入依赖的package包/类
/**
* Save a {@link RandomAccessibleInterval} of {@link LongType} into an HDF5
* uint64 dataset.
*
* @param source source
* @param dimensions dimensions of the dataset if created new
* @param writer
* @param dataset
* @param cellDimensions
*/
static public void createUnsignedLong(
final IHDF5Writer writer,
final String dataset,
final Dimensions datasetDimensions,
final int[] cellDimensions )
{
final IHDF5LongWriter uint64Writer = writer.uint64();
if ( writer.exists( dataset ) )
writer.delete( dataset );
uint64Writer.createMDArray(
dataset,
reorder( Intervals.dimensionsAsLongArray( datasetDimensions ) ),
reorder( cellDimensions ),
HDF5IntStorageFeatures.INT_AUTO_SCALING_DEFLATE );
}
示例3: createLong
import ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures; //导入依赖的package包/类
/**
* Create anHDF5 int64 dataset.
*
* @param source source
* @param dimensions dimensions of the dataset if created new
* @param writer
* @param dataset
* @param cellDimensions
*/
static public void createLong(
final IHDF5Writer writer,
final String dataset,
final Dimensions datasetDimensions,
final int[] cellDimensions )
{
final IHDF5LongWriter int64Writer = writer.int64();
if ( writer.exists( dataset ) )
writer.delete( dataset );
int64Writer.createMDArray(
dataset,
reorder( Intervals.dimensionsAsLongArray( datasetDimensions ) ),
reorder( cellDimensions ),
HDF5IntStorageFeatures.INT_AUTO_SCALING_DEFLATE );
}
示例4: saveUnsignedShort
import ch.systemsx.cisd.hdf5.HDF5IntStorageFeatures; //导入依赖的package包/类
/**
* Save a {@link RandomAccessibleInterval} of {@link ShortType} into an HDF5
* uint16 dataset.
*
* @param source
* @param writer
* @param dataset
* @param cellDimensions
*/
static public void saveUnsignedShort(
final RandomAccessibleInterval< ShortType > source,
final IHDF5Writer writer,
final String dataset,
final int[] cellDimensions )
{
final int n = source.numDimensions();
final long[] dimensions = Intervals.dimensionsAsLongArray( source );
final IHDF5ShortWriter uint16Writer = writer.uint16();
if ( !writer.exists( dataset ) )
uint16Writer.createMDArray(
dataset,
reorder( dimensions ),
reorder( cellDimensions ),
HDF5IntStorageFeatures.INT_AUTO_SCALING_DEFLATE );
final long[] offset = new long[ n ];
final long[] sourceCellDimensions = new long[ n ];
for ( int d = 0; d < n; )
{
cropCellDimensions( source, offset, cellDimensions, sourceCellDimensions );
final RandomAccessibleInterval< ShortType > sourceBlock = Views.offsetInterval( source, offset, sourceCellDimensions );
final MDShortArray targetCell = new MDShortArray( reorder( sourceCellDimensions ) );
int i = 0;
for ( final ShortType t : Views.flatIterable( sourceBlock ) )
targetCell.set( t.get(), i++ );
uint16Writer.writeMDArrayBlockWithOffset( dataset, targetCell, reorder( offset ) );
for ( d = 0; d < n; ++d )
{
offset[ d ] += cellDimensions[ d ];
if ( offset[ d ] < source.dimension( d ) )
break;
else
offset[ d ] = 0;
}
}
}