Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scalableminds/webknossos into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzenklotz committed Oct 21, 2024
2 parents e401934 + fb9b450 commit 5cb454b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a bug during dataset upload in case the configured `datastore.baseFolder` is an absolute path. [#8098](https://github.com/scalableminds/webknossos/pull/8098) [#8103](https://github.com/scalableminds/webknossos/pull/8103)
- Fixed that the skeleton search did not automatically expand groups that contained the selected tree [#8129](https://github.com/scalableminds/webknossos/pull/8129)
- Fixed a bug that zarr streaming version 3 returned the shape of mag (1, 1, 1) / the finest mag for all mags. [#8116](https://github.com/scalableminds/webknossos/pull/8116)
- Fixed sorting of mags in outbound zarr streaming. [#8125](https://github.com/scalableminds/webknossos/pull/8125)
- Fixed a bug where you could not create annotations for public datasets of other organizations. [#8107](https://github.com/scalableminds/webknossos/pull/8107)
- Users without edit permissions to a dataset can no longer delete sharing tokens via the API. [#8083](https://github.com/scalableminds/webknossos/issues/8083)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ZarrStreamingController @Inject()(
datasetName,
dataLayerName) ?~> Messages(
"dataSource.notFound") ~> NOT_FOUND
omeNgffHeader = NgffMetadata.fromNameVoxelSizeAndMags(dataLayerName, dataSource.scale, dataLayer.resolutions)
omeNgffHeader = NgffMetadata.fromNameVoxelSizeAndMags(dataLayerName, dataSource.scale, dataLayer.sortedMags)
} yield Ok(Json.toJson(omeNgffHeader))
}
}
Expand All @@ -82,7 +82,7 @@ class ZarrStreamingController @Inject()(
"dataSource.notFound") ~> NOT_FOUND
omeNgffHeaderV0_5 = NgffMetadataV0_5.fromNameVoxelSizeAndMags(dataLayerName,
dataSource.scale,
dataLayer.resolutions,
dataLayer.sortedMags,
dataLayer.additionalAxes)
zarr3GroupHeader = Zarr3GroupHeader(3, "group", Some(omeNgffHeaderV0_5))
} yield Ok(Json.toJson(zarr3GroupHeader))
Expand Down Expand Up @@ -110,7 +110,7 @@ class ZarrStreamingController @Inject()(
"dataSource.notFound") ~> NOT_FOUND
dataSourceOmeNgffHeader = NgffMetadata.fromNameVoxelSizeAndMags(dataLayerName,
dataSource.scale,
dataLayer.resolutions)
dataLayer.sortedMags)
} yield Ok(Json.toJson(dataSourceOmeNgffHeader))
)
}
Expand All @@ -136,7 +136,7 @@ class ZarrStreamingController @Inject()(
"dataSource.notFound") ~> NOT_FOUND
dataSourceOmeNgffHeader = NgffMetadataV0_5.fromNameVoxelSizeAndMags(dataLayerName,
dataSource.scale,
dataLayer.resolutions,
dataLayer.sortedMags,
dataLayer.additionalAxes)
zarr3GroupHeader = Zarr3GroupHeader(3, "group", Some(dataSourceOmeNgffHeader))
} yield Ok(Json.toJson(zarr3GroupHeader))
Expand Down Expand Up @@ -173,7 +173,7 @@ class ZarrStreamingController @Inject()(
s.name,
s.boundingBox,
s.elementClass,
mags = s.resolutions.map(x => MagLocator(x, None, None, Some(AxisOrder.cAdditionalxyz(rank)), None, None)),
mags = s.sortedMags.map(x => MagLocator(x, None, None, Some(AxisOrder.cAdditionalxyz(rank)), None, None)),
mappings = s.mappings,
largestSegmentId = s.largestSegmentId,
numChannels = Some(if (s.elementClass == ElementClass.uint24) 3 else 1),
Expand All @@ -190,7 +190,7 @@ class ZarrStreamingController @Inject()(
d.category,
d.boundingBox,
d.elementClass,
mags = d.resolutions.map(x => MagLocator(x, None, None, Some(AxisOrder.cAdditionalxyz(rank)), None, None)),
mags = d.sortedMags.map(x => MagLocator(x, None, None, Some(AxisOrder.cAdditionalxyz(rank)), None, None)),
numChannels = Some(if (d.elementClass == ElementClass.uint24) 3 else 1),
defaultViewConfiguration = d.defaultViewConfiguration,
adminViewConfiguration = d.adminViewConfiguration,
Expand Down Expand Up @@ -480,7 +480,7 @@ class ZarrStreamingController @Inject()(
for {
(_, dataLayer) <- dataSourceRepository.getDataSourceAndDataLayer(organizationId, datasetName, dataLayerName) ?~> Messages(
"dataSource.notFound") ~> NOT_FOUND
mags = dataLayer.resolutions
mags = dataLayer.sortedMags
additionalFiles = if (zarrVersion == 2)
List(NgffMetadata.FILENAME_DOT_ZATTRS, NgffGroupHeader.FILENAME_DOT_ZGROUP)
else List(Zarr3ArrayHeader.FILENAME_ZARR_JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ trait DataLayerLike {

def resolutions: List[Vec3Int]

lazy val sortedMags: List[Vec3Int] = resolutions.sortBy(_.maxDim)

def elementClass: ElementClass.Value

// This is the default from the DataSource JSON.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ class VolumeTracingZarrStreamingController @Inject()(
for {
tracing <- tracingService.find(tracingId) ?~> Messages("tracing.notFound") ~> NOT_FOUND

existingMags = tracing.resolutions.map(vec3IntFromProto)
sortedExistingMags = tracing.resolutions.map(vec3IntFromProto).toList.sortBy(_.maxDim)
dataSource <- remoteWebknossosClient.getDataSourceForTracing(tracingId) ~> NOT_FOUND
omeNgffHeader = NgffMetadataV0_5.fromNameVoxelSizeAndMags(tracingId,
dataSourceVoxelSize = dataSource.scale,
mags = existingMags.toList,
mags = sortedExistingMags,
additionalAxes = dataSource.additionalAxesUnion)
zarr3GroupHeader = Zarr3GroupHeader(3, "group", Some(omeNgffHeader))
} yield Ok(Json.toJson(zarr3GroupHeader))
Expand Down

0 comments on commit 5cb454b

Please sign in to comment.