本文整理匯總了TypeScript中neuroglancer/util/geom.vec3.clone方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript vec3.clone方法的具體用法?TypeScript vec3.clone怎麽用?TypeScript vec3.clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neuroglancer/util/geom.vec3
的用法示例。
在下文中一共展示了vec3.clone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例2: 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;
}