Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scalableminds/webknossos into emp…
Browse files Browse the repository at this point in the history
…ty-list-drawings

* 'master' of github.com:scalableminds/webknossos:
  Fix bug in fallback rendering when layer has missing mags (#7082)
  Fix duplicate on volumes with no fallback layer (#7085)
  • Loading branch information
hotzenklotz committed May 17, 2023
2 parents df0a41b + 67cbb88 commit c66b2fa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed the datasource-properties.json route for zarr-streaminge export of datasets that are not wkw/zarr. [#7065](https://github.com/scalableminds/webknossos/pull/7065)
- Fixed an issue where you could no longer invite users to your organization even though you had space left. [#7078](https://github.com/scalableminds/webknossos/pull/7078)
- Fixed displayed units of used storage in the organization's overview page. [#7057](https://github.com/scalableminds/webknossos/pull/7057)
- Fixed a rendering bug that could occur when a dataset layer has missing mags (e.g., the first mag is 8-8-8). [#7082](https://github.com/scalableminds/webknossos/pull/7082)
- Fixed a bug where some volume annotations could not be duplicated or used as tasks. [#7085](https://github.com/scalableminds/webknossos/pull/7085)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,20 @@ class PlaneMaterialFactory {
let representativeMagForVertexAlignment: Vector3 = [Infinity, Infinity, Infinity];
for (const [layerName, activeMagIndex] of Object.entries(activeMagIndices)) {
const layer = getLayerByName(Store.getState().dataset, layerName);
const activeMag = getResolutionInfo(layer.resolutions).getResolutionByIndex(
activeMagIndex,
);
const resolutionInfo = getResolutionInfo(layer.resolutions);
// If the active mag doesn't exist, a fallback mag is likely rendered. Use that
// to determine a representative mag.
const suitableMagIndex = resolutionInfo.getIndexOrClosestHigherIndex(activeMagIndex);
const suitableMag =
suitableMagIndex != null
? resolutionInfo.getResolutionByIndex(suitableMagIndex)
: null;

const hasTransform = !_.isEqual(getTransformsForLayer(layer), Identity4x4);
if (!hasTransform && activeMag) {
if (!hasTransform && suitableMag) {
representativeMagForVertexAlignment = V3.min(
representativeMagForVertexAlignment,
activeMag,
suitableMag,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ class VolumeTracingController @Inject()(
editPositionParsed <- Fox.runOptional(editPosition)(Vec3Int.fromUriLiteral)
editRotationParsed <- Fox.runOptional(editRotation)(Vec3Double.fromUriLiteral)
boundingBoxParsed <- Fox.runOptional(boundingBox)(BoundingBox.fromLiteral)
remoteFallbackLayer <- tracingService.remoteFallbackLayerFromVolumeTracing(tracing, tracingId)
remoteFallbackLayerOpt <- Fox.runIf(tracing.mappingIsEditable.contains(true))(
tracingService.remoteFallbackLayerFromVolumeTracing(tracing, tracingId))
newEditableMappingId <- Fox.runIf(tracing.mappingIsEditable.contains(true))(
editableMappingService.duplicate(tracing.mappingName, version = None, remoteFallbackLayer, userToken))
editableMappingService.duplicate(tracing.mappingName, version = None, remoteFallbackLayerOpt, userToken))
(newId, newTracing) <- tracingService.duplicate(
tracingId,
tracing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ class EditableMappingService @Inject()(

def duplicate(editableMappingIdOpt: Option[String],
version: Option[Long],
remoteFallbackLayer: RemoteFallbackLayer,
remoteFallbackLayerOpt: Option[RemoteFallbackLayer],
userToken: Option[String]): Fox[String] =
for {
editableMappingId <- editableMappingIdOpt ?~> "duplicate on editable mapping without id"
remoteFallbackLayer <- remoteFallbackLayerOpt ?~> "duplicate on editable mapping without remote fallback layer"
editableMappingInfoAndVersion <- getInfoAndActualVersion(editableMappingId,
version,
remoteFallbackLayer,
Expand Down Expand Up @@ -635,7 +636,7 @@ class EditableMappingService @Inject()(
for {
firstMappingId <- editableMappingIds.headOption.toFox
before = Instant.now
newMappingId <- duplicate(Some(firstMappingId), version = None, remoteFallbackLayer, userToken)
newMappingId <- duplicate(Some(firstMappingId), version = None, Some(remoteFallbackLayer), userToken)
_ <- Fox.serialCombined(editableMappingIds.tail)(editableMappingId =>
mergeInto(newMappingId, editableMappingId, remoteFallbackLayer, userToken))
_ = logger.info(s"Merging ${editableMappingIds.length} editable mappings took ${Instant.since(before)}")
Expand Down

0 comments on commit c66b2fa

Please sign in to comment.