本文整理匯總了TypeScript中neuroglancer/sliceview/base.VolumeChunkSpecification.make方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript VolumeChunkSpecification.make方法的具體用法?TypeScript VolumeChunkSpecification.make怎麽用?TypeScript VolumeChunkSpecification.make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neuroglancer/sliceview/base.VolumeChunkSpecification
的用法示例。
在下文中一共展示了VolumeChunkSpecification.make方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getSources
getSources(volumeSourceOptions: VolumeSourceOptions) {
let sources: VolumeChunkSource[][] = [];
let numLevels = this.numLevels;
if (numLevels === undefined) {
numLevels = computeStackHierarchy(this.stackInfo, this.dims[0]);
}
for (let level = 0; level < numLevels; level++) {
let voxelSize = vec3.clone(this.stackInfo.voxelResolution);
let chunkDataSize = vec3.fromValues(1, 1, 1);
// tiles are NxMx1
for (let i = 0; i < 2; ++i) {
voxelSize[i] = voxelSize[i] * Math.pow(2, level);
chunkDataSize[i] = this.dims[i];
}
let lowerVoxelBound = vec3.create(), upperVoxelBound = vec3.create();
for (let i = 0; i < 3; i++) {
lowerVoxelBound[i] = Math.floor(
this.stackInfo.lowerVoxelBound[i] * (this.stackInfo.voxelResolution[i] / voxelSize[i]));
upperVoxelBound[i] = Math.ceil(
this.stackInfo.upperVoxelBound[i] * (this.stackInfo.voxelResolution[i] / voxelSize[i]));
}
let spec = VolumeChunkSpecification.make({
voxelSize,
chunkDataSize,
numChannels: this.numChannels,
dataType: this.dataType, lowerVoxelBound, upperVoxelBound, volumeSourceOptions,
});
let source = TileChunkSource.get(this.chunkManager, spec, {
'baseUrls': this.baseUrls,
'owner': this.ownerInfo.owner,
'project': this.stackInfo.project,
'stack': this.stack,
'encoding': this.encoding,
'level': level,
'dims': `${this.dims[0]}_${this.dims[1]}`,
});
sources.push([source]);
}
return sources;
}