diff --git a/frontend/javascripts/oxalis/model/accessors/tool_accessor.ts b/frontend/javascripts/oxalis/model/accessors/tool_accessor.ts index 78dd3f1496..35dfe4c2b6 100644 --- a/frontend/javascripts/oxalis/model/accessors/tool_accessor.ts +++ b/frontend/javascripts/oxalis/model/accessors/tool_accessor.ts @@ -24,7 +24,7 @@ import { isSkeletonLayerTransformed } from "./skeletontracing_accessor"; import { reuseInstanceOnEquality } from "./accessor_helpers"; const zoomInToUseToolMessage = - "Please zoom in further to use this tool. If you want to edit volume data on this zoom level, create an annotation with restricted resolutions from the extended annotation menu in the dashboard."; + "Please zoom in further to use this tool. If you want to edit volume data on this zoom level, create an annotation with restricted magnifications from the extended annotation menu in the dashboard."; const getExplanationForDisabledVolume = ( isSegmentationTracingVisible: boolean, @@ -274,11 +274,8 @@ function getDisabledVolumeInfo(state: OxalisState) { const hasVolume = state.tracing.volumes.length > 0; const hasSkeleton = state.tracing.skeleton != null; const segmentationTracingLayer = getActiveSegmentationTracing(state); - const labeledResolution = getRenderableMagForSegmentationTracing( - state, - segmentationTracingLayer, - )?.resolution; - const isSegmentationTracingVisibleForMag = labeledResolution != null; + const labeledMag = getRenderableMagForSegmentationTracing(state, segmentationTracingLayer)?.mag; + const isSegmentationTracingVisibleForMag = labeledMag != null; const visibleSegmentationLayer = getVisibleSegmentationLayer(state); const isSegmentationTracingTransformed = segmentationTracingLayer != null && diff --git a/frontend/javascripts/oxalis/model/accessors/volumetracing_accessor.ts b/frontend/javascripts/oxalis/model/accessors/volumetracing_accessor.ts index 640ab2a374..05ab6c0cf6 100644 --- a/frontend/javascripts/oxalis/model/accessors/volumetracing_accessor.ts +++ b/frontend/javascripts/oxalis/model/accessors/volumetracing_accessor.ts @@ -192,7 +192,7 @@ function _getMagnificationInfoOfActiveSegmentationTracingLayer( return getMagnificationInfo(segmentationLayer.resolutions); } -const getResolutionInfoOfActiveSegmentationTracingLayer = memoizeOne( +const getMagnificationInfoOfActiveSegmentationTracingLayer = memoizeOne( _getMagnificationInfoOfActiveSegmentationTracingLayer, ); export function getServerVolumeTracings( @@ -213,9 +213,9 @@ export function getContourTracingMode(volumeTracing: VolumeTracing): ContourMode } const MAG_THRESHOLDS_FOR_ZOOM: Partial> = { - // Note that these are relative to the lowest existing resolution index. + // Note that these are relative to the lowest existing mag index. // A threshold of 1 indicates that the respective tool can be used in the - // lowest existing resolution as well as the next highest one. + // lowest existing mag as well as the next highest one. [AnnotationToolEnum.TRACE]: 1, [AnnotationToolEnum.ERASE_TRACE]: 1, [AnnotationToolEnum.BRUSH]: 3, @@ -244,28 +244,28 @@ export function isVolumeAnnotationDisallowedForZoom(tool: AnnotationTool, state: return true; } - const volumeResolutions = getResolutionInfoOfActiveSegmentationTracingLayer(state); - const lowestExistingResolutionIndex = volumeResolutions.getFinestMagIndex(); - // The current resolution is too high for the tool + const volumeMags = getMagnificationInfoOfActiveSegmentationTracingLayer(state); + const lowestExistingMagIndex = volumeMags.getFinestMagIndex(); + // The current mag is too high for the tool // because too many voxels could be annotated at the same time. const isZoomStepTooHigh = getActiveMagIndexForLayer(state, activeSegmentation.tracingId) > - threshold + lowestExistingResolutionIndex; + threshold + lowestExistingMagIndex; return isZoomStepTooHigh; } const MAX_BRUSH_SIZE_FOR_MAG1 = 300; export function getMaximumBrushSize(state: OxalisState) { - const volumeResolutions = getResolutionInfoOfActiveSegmentationTracingLayer(state); + const volumeMags = getMagnificationInfoOfActiveSegmentationTracingLayer(state); - if (volumeResolutions.magnifications.length === 0) { + if (volumeMags.magnifications.length === 0) { return MAX_BRUSH_SIZE_FOR_MAG1; } - const lowestExistingResolutionIndex = volumeResolutions.getFinestMagIndex(); + const lowestExistingMagIndex = volumeMags.getFinestMagIndex(); // For each leading magnification which does not exist, // we double the maximum brush size. - return MAX_BRUSH_SIZE_FOR_MAG1 * 2 ** lowestExistingResolutionIndex; + return MAX_BRUSH_SIZE_FOR_MAG1 * 2 ** lowestExistingMagIndex; } export function getRequestedOrVisibleSegmentationLayer( @@ -476,16 +476,16 @@ export function getActiveSegmentPosition(state: OxalisState): Vector3 | null | u } /* - This function returns the resolution and zoom step in which the given segmentation + This function returns the mag and zoom step in which the given segmentation tracing layer is currently rendered (if it is rendered). These properties should be used when labeling volume data. */ -function _getRenderableResolutionForSegmentationTracing( +function _getRenderableMagForSegmentationTracing( state: OxalisState, segmentationTracing: VolumeTracing | null | undefined, ): | { - resolution: Vector3; + mag: Vector3; zoomStep: number; } | null @@ -498,7 +498,7 @@ function _getRenderableResolutionForSegmentationTracing( const requestedZoomStep = getActiveMagIndexForLayer(state, segmentationLayer.name); const { renderMissingDataBlack } = state.datasetConfiguration; - const resolutionInfo = getMagnificationInfo(segmentationLayer.resolutions); + const magInfo = getMagnificationInfo(segmentationLayer.resolutions); // Check whether the segmentation layer is enabled const segmentationSettings = state.datasetConfiguration.layers[segmentationLayer.name]; @@ -507,20 +507,20 @@ function _getRenderableResolutionForSegmentationTracing( } // Check whether the requested zoom step exists - if (resolutionInfo.hasIndex(requestedZoomStep)) { + if (magInfo.hasIndex(requestedZoomStep)) { return { zoomStep: requestedZoomStep, - resolution: resolutionInfo.getMagByIndexOrThrow(requestedZoomStep), + mag: magInfo.getMagByIndexOrThrow(requestedZoomStep), }; } - // Since `renderMissingDataBlack` is enabled, the fallback resolutions + // Since `renderMissingDataBlack` is enabled, the fallback mags // should not be considered. if (renderMissingDataBlack) { return null; } - // The current resolution is missing and fallback rendering + // The current mag is missing and fallback rendering // is activated. Thus, check whether one of the fallback // zoomSteps can be rendered. for ( @@ -528,10 +528,10 @@ function _getRenderableResolutionForSegmentationTracing( fallbackZoomStep <= requestedZoomStep + MAX_ZOOM_STEP_DIFF; fallbackZoomStep++ ) { - if (resolutionInfo.hasIndex(fallbackZoomStep)) { + if (magInfo.hasIndex(fallbackZoomStep)) { return { zoomStep: fallbackZoomStep, - resolution: resolutionInfo.getMagByIndexOrThrow(fallbackZoomStep), + mag: magInfo.getMagByIndexOrThrow(fallbackZoomStep), }; } } @@ -540,12 +540,12 @@ function _getRenderableResolutionForSegmentationTracing( } export const getRenderableMagForSegmentationTracing = reuseInstanceOnEquality( - _getRenderableResolutionForSegmentationTracing, + _getRenderableMagForSegmentationTracing, ); function _getRenderableMagForActiveSegmentationTracing(state: OxalisState): | { - resolution: Vector3; + mag: Vector3; zoomStep: number; } | null diff --git a/frontend/javascripts/oxalis/model/bucket_data_handling/bounding_box.ts b/frontend/javascripts/oxalis/model/bucket_data_handling/bounding_box.ts index ca78fe869d..047097c1dd 100644 --- a/frontend/javascripts/oxalis/model/bucket_data_handling/bounding_box.ts +++ b/frontend/javascripts/oxalis/model/bucket_data_handling/bounding_box.ts @@ -34,13 +34,13 @@ class BoundingBox { return [u, v]; } - getBoxForZoomStep = _.memoize((resolution: Vector3): BoundingBoxType => { + getBoxForZoomStep = _.memoize((mag: Vector3): BoundingBoxType => { // No `map` for performance reasons const min = [0, 0, 0] as Vector3; const max = [0, 0, 0] as Vector3; for (let i = 0; i < 3; i++) { - const divisor = constants.BUCKET_WIDTH * resolution[i]; + const divisor = constants.BUCKET_WIDTH * mag[i]; min[i] = Math.floor(this.min[i] / divisor); max[i] = Math.ceil(this.max[i] / divisor); } @@ -51,16 +51,16 @@ class BoundingBox { }; }); - containsBucket([x, y, z, zoomStep]: Vector4, resolutionInfo: MagnificationInfo): boolean { + containsBucket([x, y, z, zoomStep]: Vector4, magInfo: MagnificationInfo): boolean { /* Checks whether a bucket is contained in the active bounding box. - * If the passed resolutionInfo does not contain the passed zoomStep, this method + * If the passed magInfo does not contain the passed zoomStep, this method * returns false. */ - const resolutionIndex = resolutionInfo.getMagByIndex(zoomStep); - if (resolutionIndex == null) { + const magIndex = magInfo.getMagByIndex(zoomStep); + if (magIndex == null) { return false; } - const { min, max } = this.getBoxForZoomStep(resolutionIndex); + const { min, max } = this.getBoxForZoomStep(magIndex); return min[0] <= x && x < max[0] && min[1] <= y && y < max[1] && min[2] <= z && z < max[2]; } diff --git a/frontend/javascripts/oxalis/model/bucket_data_handling/bucket.ts b/frontend/javascripts/oxalis/model/bucket_data_handling/bucket.ts index 0703ace532..65362bdcd7 100644 --- a/frontend/javascripts/oxalis/model/bucket_data_handling/bucket.ts +++ b/frontend/javascripts/oxalis/model/bucket_data_handling/bucket.ts @@ -187,12 +187,12 @@ export class DataBucket { } getBoundingBox(): BoundingBoxType { - const min = bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.resolutionInfo); - const bucketResolution = this.cube.resolutionInfo.getMagByIndexOrThrow(this.zoomedAddress[3]); + const min = bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.magInfo); + const bucketMag = this.cube.magInfo.getMagByIndexOrThrow(this.zoomedAddress[3]); const max: Vector3 = [ - min[0] + Constants.BUCKET_WIDTH * bucketResolution[0], - min[1] + Constants.BUCKET_WIDTH * bucketResolution[1], - min[2] + Constants.BUCKET_WIDTH * bucketResolution[2], + min[0] + Constants.BUCKET_WIDTH * bucketMag[0], + min[1] + Constants.BUCKET_WIDTH * bucketMag[1], + min[2] + Constants.BUCKET_WIDTH * bucketMag[2], ]; return { min, @@ -201,7 +201,7 @@ export class DataBucket { } getGlobalPosition(): Vector3 { - return bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.resolutionInfo); + return bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.magInfo); } getTopLeftInMag(): Vector3 { @@ -707,9 +707,9 @@ export class DataBucket { if (this.zoomedAddress[3] === zoomStep) { // @ts-ignore this.visualizedMesh = window.addBucketMesh( - bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.resolutionInfo), + bucketPositionToGlobalAddress(this.zoomedAddress, this.cube.magInfo), this.zoomedAddress[3], - this.cube.resolutionInfo.getMagByIndex(this.zoomedAddress[3]), + this.cube.magInfo.getMagByIndex(this.zoomedAddress[3]), colors[this.zoomedAddress[3]] || this.visualizationColor, ); } diff --git a/frontend/javascripts/oxalis/model/bucket_data_handling/bucket_traversals.ts b/frontend/javascripts/oxalis/model/bucket_data_handling/bucket_traversals.ts index c19f95bf2e..1a623cd89e 100644 --- a/frontend/javascripts/oxalis/model/bucket_data_handling/bucket_traversals.ts +++ b/frontend/javascripts/oxalis/model/bucket_data_handling/bucket_traversals.ts @@ -14,7 +14,7 @@ import { mod } from "libs/utils"; // Attention: Note that the implemented paper export default function traverse( startPosition: Vector3, endPosition: Vector3, - resolutions: Array, + mags: Array, zoomStep: number, ): Vector3[] { // The equation of the ray is →u + t→ v for t ≥ 0. The new traversal algorithm breaks down the ray into intervals of t, @@ -22,11 +22,11 @@ export default function traverse( const u = startPosition; const v = V3.sub(endPosition, startPosition); // The initialization phase begins by identifying the voxel in which the ray origin, → u, is found. - const uBucket = globalPositionToBucketPosition(startPosition, resolutions, zoomStep, null); - const lastBucket = globalPositionToBucketPosition(endPosition, resolutions, zoomStep, null); + const uBucket = globalPositionToBucketPosition(startPosition, mags, zoomStep, null); + const lastBucket = globalPositionToBucketPosition(endPosition, mags, zoomStep, null); // The integer variables X and Y are initialized to the starting voxel coordinates. let [X, Y, Z] = uBucket; - const voxelSize = getBucketExtent(resolutions[zoomStep]); + const voxelSize = getBucketExtent(mags[zoomStep]); // In addition, the variables stepX and stepY are initialized to either 1 or -1 indicating whether X and Y are // incremented or decremented as the ray crosses voxel boundaries (this is determined by the sign of the x and y components of → v). const [stepX, stepY, stepZ] = v.map((el) => Math.sign(el)); diff --git a/frontend/javascripts/oxalis/model/bucket_data_handling/data_cube.ts b/frontend/javascripts/oxalis/model/bucket_data_handling/data_cube.ts index 3e95f3794c..5d91a364e2 100644 --- a/frontend/javascripts/oxalis/model/bucket_data_handling/data_cube.ts +++ b/frontend/javascripts/oxalis/model/bucket_data_handling/data_cube.ts @@ -82,7 +82,7 @@ class DataCube { temporalBucketManager: TemporalBucketManager; isSegmentation: boolean; elementClass: ElementClass; - resolutionInfo: MagnificationInfo; + magInfo: MagnificationInfo; layerName: string; emitter: Emitter; lastRequestForValueSet: number | null = null; @@ -106,14 +106,14 @@ class DataCube { constructor( layerBBox: BoundingBox, additionalAxes: AdditionalAxis[], - resolutionInfo: MagnificationInfo, + magInfo: MagnificationInfo, elementClass: ElementClass, isSegmentation: boolean, layerName: string, ) { this.elementClass = elementClass; this.isSegmentation = isSegmentation; - this.resolutionInfo = resolutionInfo; + this.magInfo = magInfo; this.layerName = layerName; this.additionalAxes = _.keyBy(additionalAxes, "name"); this.emitter = createNanoEvents(); @@ -213,7 +213,7 @@ class DataCube { return false; } - return this.boundingBox.containsBucket([x, y, z, zoomStep], this.resolutionInfo); + return this.boundingBox.containsBucket([x, y, z, zoomStep], this.magInfo); } getBucketIndexAndCube([x, y, z, zoomStep, coords]: BucketAddress): [ @@ -239,8 +239,8 @@ class DataCube { ): CubeEntry | null { const cubeKey = this.getCubeKey(zoomStep, coords); if (this.cubes[cubeKey] == null) { - const resolution = this.resolutionInfo.getMagByIndex(zoomStep); - if (resolution == null) { + const mag = this.magInfo.getMagByIndex(zoomStep); + if (mag == null) { return null; } @@ -254,9 +254,9 @@ class DataCube { } const zoomedCubeBoundary: Vector3 = [ - Math.ceil(this.boundingBox.max[0] / (constants.BUCKET_WIDTH * resolution[0])) + 1, - Math.ceil(this.boundingBox.max[1] / (constants.BUCKET_WIDTH * resolution[1])) + 1, - Math.ceil(this.boundingBox.max[2] / (constants.BUCKET_WIDTH * resolution[2])) + 1, + Math.ceil(this.boundingBox.max[0] / (constants.BUCKET_WIDTH * mag[0])) + 1, + Math.ceil(this.boundingBox.max[1] / (constants.BUCKET_WIDTH * mag[1])) + 1, + Math.ceil(this.boundingBox.max[2] / (constants.BUCKET_WIDTH * mag[2])) + 1, ]; this.cubes[cubeKey] = new CubeEntry(zoomedCubeBoundary); } @@ -342,7 +342,7 @@ class DataCube { { elementClass: this.elementClass, isSegmentation: this.isSegmentation, - resolutionInfo: this.resolutionInfo, + magInfo: this.magInfo, }, "warning", ); @@ -433,13 +433,13 @@ class DataCube { // Please make use of a LabeledVoxelsMap instead. const promises = []; - for (const [resolutionIndex] of this.resolutionInfo.getMagsWithIndices()) { + for (const [magIndex] of this.magInfo.getMagsWithIndices()) { promises.push( - this._labelVoxelInResolution_DEPRECATED( + this._labelVoxelInMag_DEPRECATED( voxel, additionalCoordinates, label, - resolutionIndex, + magIndex, activeSegmentId, ), ); @@ -449,7 +449,7 @@ class DataCube { this.triggerPushQueue(); } - async _labelVoxelInResolution_DEPRECATED( + async _labelVoxelInMag_DEPRECATED( voxel: Vector3, additionalCoordinates: AdditionalCoordinate[] | null, label: number, @@ -535,9 +535,9 @@ class DataCube { }; } - if (!this.resolutionInfo.hasIndex(zoomStep)) { + if (!this.magInfo.hasIndex(zoomStep)) { throw new Error( - `DataCube.floodFill was called with a zoomStep of ${zoomStep} which does not exist for the current resolution.`, + `DataCube.floodFill was called with a zoomStep of ${zoomStep} which does not exist for the current magnification.`, ); } @@ -630,16 +630,14 @@ class DataCube { const currentLabeledVoxelMap = bucketsWithLabeledVoxelsMap.get(currentBucket.zoomedAddress) || new Map(); - const currentResolution = this.resolutionInfo.getMagByIndexOrThrow( - currentBucket.zoomedAddress[3], - ); + const currentMag = this.magInfo.getMagByIndexOrThrow(currentBucket.zoomedAddress[3]); const markUvwInSliceAsLabeled = ([firstCoord, secondCoord, thirdCoord]: Vector3) => { // Convert bucket local W coordinate to global W (both mag-dependent) const w = dimensionIndices[2]; thirdCoord += currentBucket.getTopLeftInMag()[w]; // Convert mag-dependent W to mag-independent W - thirdCoord *= currentResolution[w]; + thirdCoord *= currentMag[w]; if (!currentLabeledVoxelMap.has(thirdCoord)) { currentLabeledVoxelMap.set( @@ -699,7 +697,7 @@ class DataCube { labeledVoxelCount++; const currentGlobalPosition = V3.add( currentGlobalBucketPosition, - V3.scale3(adjustedNeighbourVoxelXyz, currentResolution), + V3.scale3(adjustedNeighbourVoxelXyz, currentMag), ); coveredBBoxMin = [ Math.min(coveredBBoxMin[0], currentGlobalPosition[0]), @@ -785,7 +783,7 @@ class DataCube { additionalCoordinates: AdditionalCoordinate[] | null, zoomStep: number = 0, ): boolean { - // When this method returns false, this means that the next resolution (if it exists) + // When this method returns false, this means that the next mag (if it exists) // needs to be examined for rendering. const bucket = this.getBucket( this.positionToZoomedAddress(voxel, additionalCoordinates, zoomStep), @@ -823,12 +821,12 @@ class DataCube { additionalCoordinates: AdditionalCoordinate[] | null, zoomStep: number, ): number { - const resolutions = this.resolutionInfo.getDenseMagnifications(); + const mags = this.magInfo.getDenseMagnifications(); let usableZoomStep = zoomStep; while ( position && - usableZoomStep < resolutions.length - 1 && + usableZoomStep < mags.length - 1 && !this.isZoomStepCurrentlyRenderableForVoxel(position, additionalCoordinates, usableZoomStep) ) { usableZoomStep++; @@ -842,12 +840,12 @@ class DataCube { additionalCoordinates: AdditionalCoordinate[] | null, zoomStep: number, ): Promise { - const resolutions = this.resolutionInfo.getDenseMagnifications(); + const mags = this.magInfo.getDenseMagnifications(); let usableZoomStep = zoomStep; while ( position && - usableZoomStep < resolutions.length - 1 && + usableZoomStep < mags.length - 1 && !(await this.isZoomStepUltimatelyRenderableForVoxel( position, additionalCoordinates, @@ -866,7 +864,7 @@ class DataCube { mapping: Mapping | null | undefined, zoomStep: number = 0, ): number { - if (!this.resolutionInfo.hasIndex(zoomStep)) { + if (!this.magInfo.hasIndex(zoomStep)) { return 0; } @@ -922,10 +920,10 @@ class DataCube { getVoxelOffset(voxel: Vector3, zoomStep: number = 0): Vector3 { // No `map` for performance reasons const voxelOffset: Vector3 = [0, 0, 0]; - const resolution = this.resolutionInfo.getMagByIndexOrThrow(zoomStep); + const mag = this.magInfo.getMagByIndexOrThrow(zoomStep); for (let i = 0; i < 3; i++) { - voxelOffset[i] = Math.floor(voxel[i] / resolution[i]) % constants.BUCKET_WIDTH; + voxelOffset[i] = Math.floor(voxel[i] / mag[i]) % constants.BUCKET_WIDTH; } return voxelOffset; @@ -944,7 +942,7 @@ class DataCube { // return the bucket a given voxel lies in return globalPositionToBucketPosition( position, - this.resolutionInfo.getDenseMagnifications(), + this.magInfo.getDenseMagnifications(), zoomStep, additionalCoordinates, ); diff --git a/frontend/javascripts/oxalis/model/bucket_data_handling/wkstore_adapter.ts b/frontend/javascripts/oxalis/model/bucket_data_handling/wkstore_adapter.ts index cc440136f0..7b3b803677 100644 --- a/frontend/javascripts/oxalis/model/bucket_data_handling/wkstore_adapter.ts +++ b/frontend/javascripts/oxalis/model/bucket_data_handling/wkstore_adapter.ts @@ -288,7 +288,7 @@ export async function createCompressedUpdateBucketActions( const compressedBase64Strings = await compressionPool.submit(byteArrays); return compressedBase64Strings.map((compressedBase64, index) => { const bucket = batchSubset[index]; - const bucketInfo = createSendBucketInfo(bucket.zoomedAddress, bucket.cube.resolutionInfo); + const bucketInfo = createSendBucketInfo(bucket.zoomedAddress, bucket.cube.magInfo); return updateBucket(bucketInfo, compressedBase64); }); }), diff --git a/frontend/javascripts/test/model/binary/cube.spec.ts b/frontend/javascripts/test/model/binary/cube.spec.ts index 741f102aa7..4331e4f881 100644 --- a/frontend/javascripts/test/model/binary/cube.spec.ts +++ b/frontend/javascripts/test/model/binary/cube.spec.ts @@ -143,7 +143,7 @@ test("GetBucket should only create one bucket on getOrCreateBucket()", (t) => { test("Voxel Labeling should request buckets when temporal buckets are created", (t) => { const { cube, pullQueue } = t.context; - cube._labelVoxelInResolution_DEPRECATED([1, 1, 1], null, 42, 0, null); + cube._labelVoxelInMag_DEPRECATED([1, 1, 1], null, 42, 0, null); t.plan(1); return runAsync([ @@ -157,7 +157,7 @@ test("Voxel Labeling should request buckets when temporal buckets are created", }); test("Voxel Labeling should push buckets after they were pulled", async (t) => { const { cube, pushQueue } = t.context; - await cube._labelVoxelInResolution_DEPRECATED([1, 1, 1], null, 42, 0, null); + await cube._labelVoxelInMag_DEPRECATED([1, 1, 1], null, 42, 0, null); t.plan(1); const bucket = cube.getBucket([0, 0, 0, 0, []]); return runAsync([ @@ -172,7 +172,7 @@ test("Voxel Labeling should push buckets immediately if they are pulled already" assertNonNullBucket(bucket); bucket.markAsPulled(); bucket.receiveData(new Uint8Array(4 * 32 ** 3)); - await cube._labelVoxelInResolution_DEPRECATED([0, 0, 0], null, 42, 0, null); + await cube._labelVoxelInMag_DEPRECATED([0, 0, 0], null, 42, 0, null); t.plan(1); return runAsync([ () => { @@ -183,9 +183,9 @@ test("Voxel Labeling should push buckets immediately if they are pulled already" test("Voxel Labeling should only instantiate one bucket when labelling the same bucket twice", async (t) => { const { cube } = t.context; // Creates bucket - await cube._labelVoxelInResolution_DEPRECATED([0, 0, 0], null, 42, 0, null); + await cube._labelVoxelInMag_DEPRECATED([0, 0, 0], null, 42, 0, null); // Uses existing bucket - await cube._labelVoxelInResolution_DEPRECATED([1, 0, 0], null, 43, 0, null); + await cube._labelVoxelInMag_DEPRECATED([1, 0, 0], null, 43, 0, null); const data = cube.getBucket([0, 0, 0, 0, []]).getData(); t.is(data[0], 42); t.is(data[1], 43); @@ -193,13 +193,13 @@ test("Voxel Labeling should only instantiate one bucket when labelling the same test("getDataValue() should return the raw value without a mapping", async (t) => { const { cube } = t.context; const value = 1 * (1 << 16) + 2 * (1 << 8) + 3; - await cube._labelVoxelInResolution_DEPRECATED([0, 0, 0], null, value, 0, null); + await cube._labelVoxelInMag_DEPRECATED([0, 0, 0], null, value, 0, null); t.is(cube.getDataValue([0, 0, 0], null, null), value); }); test("getDataValue() should return the mapping value if available", async (t) => { const { cube } = t.context; - await cube._labelVoxelInResolution_DEPRECATED([0, 0, 0], null, 42, 0, null); - await cube._labelVoxelInResolution_DEPRECATED([1, 1, 1], null, 43, 0, null); + await cube._labelVoxelInMag_DEPRECATED([0, 0, 0], null, 42, 0, null); + await cube._labelVoxelInMag_DEPRECATED([1, 1, 1], null, 43, 0, null); const mapping = new Map(); mapping.set(42, 1); t.is(cube.getDataValue([0, 0, 0], null, mapping), 1);