本文整理汇总了TypeScript中neuroglancer/util/geom.vec3.multiply方法的典型用法代码示例。如果您正苦于以下问题:TypeScript vec3.multiply方法的具体用法?TypeScript vec3.multiply怎么用?TypeScript vec3.multiply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuroglancer/util/geom.vec3
的用法示例。
在下文中一共展示了vec3.multiply方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(options: VolumeChunkSpecificationOptions) {
let {
lowerVoxelBound = kZeroVec,
upperVoxelBound,
chunkDataSize,
voxelSize,
transform,
baseVoxelOffset = kZeroVec
} = options;
let {
lowerClipBound = vec3.multiply(vec3.create(), voxelSize, lowerVoxelBound),
upperClipBound = vec3.multiply(vec3.create(), voxelSize, upperVoxelBound)
} = options;
const chunkSize = vec3.multiply(vec3.create(), chunkDataSize, voxelSize);
let lowerChunkBound = vec3.create();
let upperChunkBound = vec3.create();
for (let i = 0; i < 3; ++i) {
lowerChunkBound[i] = Math.floor(lowerVoxelBound[i] / chunkDataSize[i]);
upperChunkBound[i] = Math.floor((upperVoxelBound[i] - 1) / chunkDataSize[i] + 1);
}
super({voxelSize, transform, lowerChunkBound, upperChunkBound, chunkSize});
this.baseVoxelOffset = baseVoxelOffset;
this.lowerClipBound = lowerClipBound;
this.upperClipBound = upperClipBound;
this.lowerVoxelBound = lowerVoxelBound;
this.upperVoxelBound = upperVoxelBound;
this.chunkDataSize = chunkDataSize;
let dataType = this.dataType = options.dataType;
let numChannels = this.numChannels = options.numChannels;
this.chunkBytes = prod3(chunkDataSize) * DATA_TYPE_BYTES[dataType] * numChannels;
this.compressedSegmentationBlockSize = options.compressedSegmentationBlockSize;
}
示例2:
return this.scales.map(scaleInfo => {
return VolumeChunkSpecification
.getDefaults({
voxelSize: scaleInfo.resolution,
dataType: this.dataType,
numChannels: this.numChannels,
transform: mat4.fromTranslation(
mat4.create(),
vec3.multiply(vec3.create(), scaleInfo.resolution, scaleInfo.voxelOffset)),
upperVoxelBound: scaleInfo.size,
volumeType: this.volumeType,
chunkDataSizes: scaleInfo.chunkSizes,
baseVoxelOffset: scaleInfo.voxelOffset,
compressedSegmentationBlockSize: scaleInfo.compressedSegmentationBlockSize,
volumeSourceOptions,
})
.map(spec => this.chunkManager.getChunkSource(PrecomputedVolumeChunkSource, {
spec,
parameters: {
'baseUrls': this.baseUrls,
'path': `${this.path}/${scaleInfo.key}`,
'encoding': scaleInfo.encoding
}
}));
});
示例3: getSources
getSources(vectorGraphicsSourceOptions: VectorGraphicsSourceOptions) {
const voxelSize = this.stackInfo.voxelResolution;
const chunkSize = vec3.subtract(
vec3.create(), this.stackInfo.upperVoxelBound, this.stackInfo.lowerVoxelBound);
vec3.multiply(chunkSize, chunkSize, voxelSize);
chunkSize[2] = voxelSize[2];
const spec = VectorGraphicsChunkSpecification.make({
voxelSize,
chunkSize,
lowerChunkBound: vec3.fromValues(0, 0, this.stackInfo.lowerVoxelBound[2]),
upperChunkBound: vec3.fromValues(1, 1, this.stackInfo.upperVoxelBound[2]),
vectorGraphicsSourceOptions
});
const source = this.chunkManager.getChunkSource(PointMatchSource, {
spec,
parameters: {
'baseUrls': this.baseUrls,
'owner': this.ownerInfo.owner,
'project': this.stackInfo.project,
'stack': this.stack,
'encoding': 'points',
'matchCollection': this.matchCollection,
'zoffset': this.zoffset
}
});
return [[source]];
}
示例4: getStaticAnnotations
getStaticAnnotations() {
const {topLevelMetadata, baseScaleIndex} = this;
const annotationSet = new AnnotationSource(mat4.fromScaling(
mat4.create(),
vec3.multiply(
vec3.create(), topLevelMetadata.pixelResolution,
topLevelMetadata.scales[baseScaleIndex])));
annotationSet.readonly = true;
annotationSet.add(makeDataBoundsBoundingBox(vec3.create(), this.scales[baseScaleIndex]!.size));
return annotationSet;
}
示例5:
return this.scales.map(scaleInfo => {
return VolumeChunkSpecification
.getDefaults({
voxelSize: scaleInfo.resolution,
dataType: this.dataType,
numChannels: this.numChannels,
chunkLayoutOffset:
vec3.multiply(vec3.create(), scaleInfo.resolution, scaleInfo.voxelOffset),
upperVoxelBound: scaleInfo.size,
volumeType: this.volumeType,
chunkDataSizes: scaleInfo.chunkSizes,
baseVoxelOffset: scaleInfo.voxelOffset,
compressedSegmentationBlockSize: scaleInfo.compressedSegmentationBlockSize
})
.map(spec => VolumeChunkSource.get(chunkManager, spec, {
'baseUrls': this.baseUrls,
'path': `${this.path}/${scaleInfo.key}`,
'encoding': scaleInfo.encoding
}));
});
示例6: getSources
getSources(chunkManager: ChunkManager) {
let {numChannels, dataType, volumeType, encoding} = this;
// Clip based on the bounds of the first scale.
const baseScale = this.scales[0][0];
let upperClipBound = vec3.multiply(vec3.create(), baseScale.voxelSize, baseScale.sizeInVoxels);
return this.scales.map(levelScales => levelScales.map(scaleInfo => {
const spec = VolumeChunkSpecification.withDefaultCompression({
voxelSize: scaleInfo.voxelSize,
dataType,
volumeType,
numChannels,
chunkLayoutOffset: scaleInfo.offset,
upperVoxelBound: scaleInfo.sizeInVoxels,
upperClipBound: upperClipBound,
chunkDataSize: scaleInfo.chunkDataSize!,
});
return VolumeChunkSource.get(
chunkManager, spec, {baseUrls: this.baseUrls, key: scaleInfo.key, encoding: encoding});
}));
}