本文整理汇总了TypeScript中neuroglancer/sliceview/volume/base.VolumeChunkSpecification.make方法的典型用法代码示例。如果您正苦于以下问题:TypeScript VolumeChunkSpecification.make方法的具体用法?TypeScript VolumeChunkSpecification.make怎么用?TypeScript VolumeChunkSpecification.make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuroglancer/sliceview/volume/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]);
}
let lowerClipBound = vec3.create(), upperClipBound = vec3.create();
// Generate and set the clip bounds based on the highest resolution (lowest scale) data in
// render. Otherwise, rounding errors can cause inconsistencies in clip bounds between scaling
// levels.
for (let i = 0; i < 3; i++) {
lowerClipBound[i] = this.stackInfo.lowerVoxelBound[i] * this.stackInfo.voxelResolution[i];
upperClipBound[i] = this.stackInfo.upperVoxelBound[i] * this.stackInfo.voxelResolution[i];
}
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,
lowerClipBound,
upperClipBound,
lowerVoxelBound,
upperVoxelBound,
volumeSourceOptions,
});
let source = this.chunkManager.getChunkSource(TileChunkSource, {
spec,
parameters: {
'baseUrls': this.baseUrls,
'owner': this.ownerInfo.owner,
'project': this.stackInfo.project,
'stack': this.stack,
'channel': this.channel,
'minIntensity': this.minIntensity,
'maxIntensity': this.maxIntensity,
'maxTileSpecsToRender': this.maxTileSpecsToRender,
'filter': this.filter,
'dims': `${this.dims[0]}_${this.dims[1]}`,
'level': level,
'encoding': this.encoding,
}
});
sources.push([source]);
}
return sources;
}