當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript base.getNearIsotropicBlockSize函數代碼示例

本文整理匯總了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}));
 }
開發者ID:google,項目名稱:neuroglancer,代碼行數:33,代碼來源:base.ts

示例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));
  });
開發者ID:google,項目名稱:neuroglancer,代碼行數:19,代碼來源:base.spec.ts

示例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}];
 });
開發者ID:funkey,項目名稱:neuroglancer,代碼行數:6,代碼來源:frontend.ts


注:本文中的neuroglancer/sliceview/base.getNearIsotropicBlockSize函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。