本文整理汇总了TypeScript中neuroglancer/sliceview/base.getNearIsotropicBlockSize函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getNearIsotropicBlockSize函数的具体用法?TypeScript getNearIsotropicBlockSize怎么用?TypeScript getNearIsotropicBlockSize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getNearIsotropicBlockSize函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: withDefaultCompression
/**
* Returns a VolumeChunkSpecification with default compression specified if suitable for the
* volumeType.
*/
static withDefaultCompression(options: VolumeChunkSpecificationDefaultCompressionOptions&
VolumeChunkSpecificationOptions&
VolumeChunkSpecificationVolumeSourceOptions) {
let {
compressedSegmentationBlockSize,
dataType,
voxelSize,
transform,
lowerVoxelBound,
upperVoxelBound
} = options;
transform = getCombinedTransform(transform, options.volumeSourceOptions);
if (compressedSegmentationBlockSize === undefined &&
options.volumeType === VolumeType.SEGMENTATION &&
(dataType === DataType.UINT32 || dataType === DataType.UINT64)) {
compressedSegmentationBlockSize = getNearIsotropicBlockSize({
voxelSize,
transform,
lowerVoxelBound,
upperVoxelBound,
maxVoxelsPerChunkLog2: 9,
maxBlockSize: vec3.min(
vec3.create(), options.chunkDataSize,
options.maxCompressedSegmentationBlockSize || kInfinityVec),
});
}
return new VolumeChunkSpecification(
Object.assign({}, options, {compressedSegmentationBlockSize, transform}));
}
示例2: it
it('getNearIsotropicBlockSize', () => {
expect(
getNearIsotropicBlockSize({voxelSize: vec3.fromValues(1, 1, 1), maxVoxelsPerChunkLog2: 18}))
.toEqual(vec3.fromValues(64, 64, 64));
expect(
getNearIsotropicBlockSize({voxelSize: vec3.fromValues(2, 1, 1), maxVoxelsPerChunkLog2: 17}))
.toEqual(vec3.fromValues(32, 64, 64));
expect(
getNearIsotropicBlockSize({voxelSize: vec3.fromValues(3, 3, 30), maxVoxelsPerChunkLog2: 9}))
.toEqual(vec3.fromValues(16, 16, 2));
expect(getNearIsotropicBlockSize({
voxelSize: vec3.fromValues(3, 3, 30),
upperVoxelBound: vec3.fromValues(1, 128, 128),
maxVoxelsPerChunkLog2: 8
})).toEqual(vec3.fromValues(1, 64, 4));
});
示例3: getNearIsotropicBlockSize
this.scales = threeDimensionalScales.map(scale => {
let {voxelSize, sizeInVoxels} = scale;
let {chunkDataSize = getNearIsotropicBlockSize(
{voxelSize, upperVoxelBound: sizeInVoxels, maxVoxelsPerChunkLog2})} = scale;
return [{key: scale.key, offset: scale.offset, sizeInVoxels, voxelSize, chunkDataSize}];
});