本文整理匯總了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}];
});