Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
4dd9409
WIP: Read zarr agglomerate files
fm3 May 19, 2025
380bd69
zarr group path
fm3 May 19, 2025
7fb643f
test reading from zarr array
fm3 May 19, 2025
f987ebf
axisOrder: make y optional
fm3 May 19, 2025
935571a
Merge branch 'master' into agglomerates-zarr
fm3 May 22, 2025
7c1cc8b
undo attempt to make axisOrder.y optional
fm3 May 22, 2025
5af14fc
read multi array, ignoring underlying storage and axis order
fm3 May 22, 2025
f055c1e
apply agglomerate
fm3 May 27, 2025
13ff0e3
offset can be long; pass tokencontext
fm3 May 27, 2025
d853389
WIP read agglomerate skeleton
fm3 May 27, 2025
56ce08b
fix reading agglomerate skeleton
fm3 May 27, 2025
2855d2b
Change DatasetArray shape from Int to Long. Implement reading largest…
fm3 May 27, 2025
4ed5483
remove unused agglomeratesForAllSegments
fm3 May 27, 2025
7f8f662
Merge branch 'master' into agglomerates-zarr
fm3 May 27, 2025
291aab5
add shortcut for shape.product==0; implement segmentIdsForAgglomerateId
fm3 May 27, 2025
0439bce
remove unused test
fm3 May 27, 2025
11027d7
implement positionForSegmentId; agglomerateIdsForSegmentIds
fm3 May 28, 2025
0c5d647
select mapping by request
fm3 May 28, 2025
90d97cd
shortcut for single-dimension shape+offset
fm3 May 28, 2025
8551f99
handle uint32 agglomerate_to_segments arrays
fm3 May 28, 2025
d183c99
useZarr=false to test ci
fm3 May 28, 2025
cd04466
change chunkIndices back to list
fm3 May 28, 2025
9eac53d
use headOption instead of list deconstruction
fm3 May 28, 2025
0105b8e
Merge branch 'master' into agglomerates-zarr
fm3 Jun 3, 2025
fd7a281
WIP distinguish btw hdf5 and zarr according to registered layer attac…
fm3 Jun 3, 2025
19641af
pass datasource id + layer
fm3 Jun 3, 2025
716794d
list attached agglomerate files
fm3 Jun 3, 2025
feb8cb4
format
fm3 Jun 3, 2025
5c924dc
Merge branch 'master' into agglomerates-zarr
fm3 Jun 4, 2025
f040483
use agglomeratefilekey as cache key for proper cache clear support
fm3 Jun 4, 2025
e781baf
clear agglomerate caches on layer/ds reload
fm3 Jun 4, 2025
419490f
avoid injection
fm3 Jun 4, 2025
9c78167
prioritize WebknossosZarrExplorer
fm3 Jun 5, 2025
fdd7b4a
cleanup
fm3 Jun 5, 2025
09dfc0c
changelog
fm3 Jun 5, 2025
10dc7c3
make dummy datasource id more explicit
fm3 Jun 10, 2025
73b2f80
WIP Read Zarr Meshfiles
fm3 Jun 10, 2025
ca30ebe
read metadata from zarr group header
fm3 Jun 10, 2025
29073e8
wip read neuroglancer segment manifests
fm3 Jun 10, 2025
41de8c8
enrich
fm3 Jun 10, 2025
adb7d07
find local offset in bucket
fm3 Jun 12, 2025
e63fb2a
sort meshfile services, lookup with MeshFileKey
fm3 Jun 12, 2025
fd8dc30
move more code
fm3 Jun 12, 2025
0f9e5c8
Merge branch 'master' into meshfile-zarr
fm3 Jun 16, 2025
00e775c
iterate on meshfile services
fm3 Jun 16, 2025
7d51512
adapt frontend to simplified protocol
fm3 Jun 16, 2025
5d1b768
keys
fm3 Jun 16, 2025
ca64481
Merge branch 'master' into agglomerates-zarr
fm3 Jun 16, 2025
8cf2853
Merge branch 'agglomerates-zarr' into meshfile-zarr
fm3 Jun 16, 2025
16b38d6
explore + list meshfiles
fm3 Jun 17, 2025
7c94d31
fix frontend type
fm3 Jun 17, 2025
93d560c
adapt schema to neuroglancerPrecomputed dataformat for attachments
fm3 Jun 17, 2025
74a0bc3
Merge branch 'master' into agglomerates-zarr
fm3 Jun 17, 2025
12a6423
Merge branch 'agglomerates-zarr' into meshfile-zarr
fm3 Jun 17, 2025
1d492d1
adapt to new json format
fm3 Jun 17, 2025
9af3004
clear caches
fm3 Jun 17, 2025
331d178
some cleanup
fm3 Jun 17, 2025
43d9051
in list request, only return successes
fm3 Jun 17, 2025
d6a9817
add migration to guide
fm3 Jun 17, 2025
73a7ac2
unify spelling meshFile
fm3 Jun 17, 2025
16ae134
fix class injection
fm3 Jun 17, 2025
8077858
Adapt full mesh service; introduce credentials for attachments
fm3 Jun 18, 2025
7d676bf
fix updating job status for jobs with no credit transactions
fm3 Jun 18, 2025
76cd9d6
fix adhocMag selection in create animation modal
fm3 Jun 18, 2025
09567eb
make typechecker happy
fm3 Jun 18, 2025
f79b171
Merge branch 'master' into agglomerates-zarr
fm3 Jun 18, 2025
e170ebe
pr feedback; add services as singletons for proper cache use
fm3 Jun 18, 2025
b76d473
Merge branch 'agglomerates-zarr' into meshfile-zarr
fm3 Jun 18, 2025
1360184
address coderabbit review suggestions
fm3 Jun 18, 2025
72d5c5b
typo
fm3 Jun 18, 2025
0c961eb
Fix dtype bug, remove singleton instantiations again
fm3 Jun 19, 2025
365ec5d
rename lookup function as suggested in pr review
fm3 Jun 19, 2025
be77185
add ucar dependency resolver
fm3 Jun 19, 2025
5920905
remove sciJava resolver
fm3 Jun 19, 2025
753c25b
Revert "remove sciJava resolver"
fm3 Jun 19, 2025
11d2611
Revert "add ucar dependency resolver"
fm3 Jun 19, 2025
a9aed9e
Merge branch 'master' into agglomerates-zarr
fm3 Jun 19, 2025
bb07185
Merge branch 'master' into agglomerates-zarr
fm3 Jun 19, 2025
d7a667a
Merge branch 'master' into agglomerates-zarr
fm3 Jun 23, 2025
2c53ae6
Merge branch 'agglomerates-zarr' into meshfile-zarr
fm3 Jun 23, 2025
cdd3075
Merge branch 'master' into meshfile-zarr
fm3 Jun 23, 2025
0fddb3d
unify function names
fm3 Jun 23, 2025
6f8ed21
Merge branch 'master' into meshfile-zarr
fm3 Jun 23, 2025
c5f12f5
WIP: Read Zarr Segment Index Files
fm3 Jun 24, 2025
b294061
introduce abstraction for attached segment index files
fm3 Jun 24, 2025
d47b240
implement arrSegmentIndexFileService
fm3 Jun 24, 2025
b1f5831
Correctly read segment index file as mag1 segment positions
fm3 Jun 24, 2025
d34fe29
unused imports
fm3 Jun 24, 2025
0f10892
Merge branch 'master' into meshfile-zarr
fm3 Jun 25, 2025
0eb73d2
implement pr feedback
fm3 Jun 25, 2025
9217eb5
unused import
fm3 Jun 25, 2025
63c5ebe
Merge branch 'meshfile-zarr' into zarr-segment-index
fm3 Jun 25, 2025
537a824
Merge branch 'master' into meshfile-zarr
fm3 Jun 25, 2025
fd932e6
same cleanup also when looking up agglomerates
fm3 Jun 25, 2025
99ec110
Merge branch 'meshfile-zarr' into zarr-segment-index
fm3 Jun 25, 2025
05f477d
add cache clear for segment index files
fm3 Jun 25, 2025
dd0e803
changelog
fm3 Jun 25, 2025
0b98d57
Merge branch 'master' into meshfile-zarr
fm3 Jun 25, 2025
56f8385
Update webknossos-datastore/app/com/scalableminds/webknossos/datastor…
fm3 Jun 25, 2025
c3dc703
Merge branch 'master' into meshfile-zarr
fm3 Jun 26, 2025
4f313b4
Merge branch 'meshfile-zarr' into zarr-segment-index
fm3 Jun 26, 2025
75fbccf
Merge branch 'master' into meshfile-zarr
MichaelBuessemeyer Jun 26, 2025
b01ce43
Merge branch 'master' into meshfile-zarr
fm3 Jun 30, 2025
b36841a
Merge branch 'meshfile-zarr' into zarr-segment-index
fm3 Jun 30, 2025
78fefbc
Merge branch 'master' into zarr-segment-index
fm3 Jun 30, 2025
aed235e
fix error message
fm3 Jun 30, 2025
1f12060
Merge branch 'master' into zarr-segment-index
fm3 Jun 30, 2025
9e73f73
Merge branch 'master' into zarr-segment-index
fm3 Jul 2, 2025
661b258
implement pr feedback; extract common string values to traits
fm3 Jul 2, 2025
313838c
format
fm3 Jul 2, 2025
2ab3ab2
Merge branch 'master' into zarr-segment-index
MichaelBuessemeyer Jul 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ mesh.file.readVersion.failed=Failed to read format version from file “{0}”
mesh.file.readMappingName.failed=Failed to read mapping name from mesh file “{0}”
mesh.meshFileName.required=Trying to load mesh from mesh file, but mesh file name was not supplied.

segmentIndexFile.notFound=Could not find requested segment index file

task.create.noTasks=Zero tasks were requested
task.create.failed=Failed to create Task
task.create.limitExceeded=Cannot create more than 1000 tasks in one request.
Expand Down
5 changes: 5 additions & 0 deletions unreleased_changes/8711.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Added
- Segment index files can now also be read from the new zarr3-based format, and from remote object storage.

### Fixed
- Fixed a bug where segment index files for segmentation layers with no mag1 would be read incorrectly.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ import org.apache.pekko.actor.ActorSystem
import com.google.inject.AbstractModule
import com.google.inject.name.Names
import com.scalableminds.webknossos.datastore.services._
import com.scalableminds.webknossos.datastore.services.mapping.{
AgglomerateService,
Hdf5AgglomerateService,
MappingService,
ZarrAgglomerateService
}
import com.scalableminds.webknossos.datastore.services.mesh.{
AdHocMeshServiceHolder,
Hdf5MeshFileService,
MeshFileService,
NeuroglancerPrecomputedMeshFileService,
ZarrMeshFileService
}
import com.scalableminds.webknossos.datastore.services.segmentindex.{
Hdf5SegmentIndexFileService,
SegmentIndexFileService,
ZarrSegmentIndexFileService
}
import com.scalableminds.webknossos.datastore.services.uploading.UploadService
import com.scalableminds.webknossos.datastore.storage.{DataVaultService, RemoteSourceDescriptorService}

Expand Down Expand Up @@ -38,6 +49,9 @@ class DataStoreModule extends AbstractModule {
bind(classOf[AgglomerateService]).asEagerSingleton()
bind(classOf[ZarrAgglomerateService]).asEagerSingleton()
bind(classOf[Hdf5AgglomerateService]).asEagerSingleton()
bind(classOf[SegmentIndexFileService]).asEagerSingleton()
bind(classOf[ZarrSegmentIndexFileService]).asEagerSingleton()
bind(classOf[Hdf5SegmentIndexFileService]).asEagerSingleton()
bind(classOf[NeuroglancerPrecomputedMeshFileService]).asEagerSingleton()
bind(classOf[RemoteSourceDescriptorService]).asEagerSingleton()
bind(classOf[ChunkCacheService]).asEagerSingleton()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.scalableminds.webknossos.datastore.services._
import com.scalableminds.webknossos.datastore.services.mesh.{AdHocMeshRequest, AdHocMeshService, AdHocMeshServiceHolder}
import com.scalableminds.webknossos.datastore.slacknotification.DSSlackNotificationService
import com.scalableminds.util.tools.Box.tryo
import com.scalableminds.webknossos.datastore.services.mapping.MappingService
import play.api.i18n.Messages
import play.api.libs.json.Json
import play.api.mvc.{AnyContent, _}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ trait SegmentStatistics extends ProtoGeometryImplicits with FoxImplicits {
implicit ec: ExecutionContext): Fox[Long] =
for {
bucketPositionsProtos: Set[Vec3IntProto] <- getBucketPositions(segmentId, mag)
bucketPositionsInMag = bucketPositionsProtos.map(vec3IntFromProto)
(bucketBoxes, elementClass) <- getDataForBucketPositions(bucketPositionsInMag.toSeq, mag, additionalCoordinates)
bucketPositionsInRequestedMag = bucketPositionsProtos.map(vec3IntFromProto)
(bucketBoxes, elementClass) <- getDataForBucketPositions(bucketPositionsInRequestedMag.toSeq,
mag,
additionalCoordinates)
counts <- Fox.serialCombined(bucketBoxes.toList) {
case Full(bucketBytes) =>
tryo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ object LayerAttachmentType extends ExtendedEnumeration {
case class LayerAttachment(name: String,
path: URI,
dataFormat: LayerAttachmentDataformat.LayerAttachmentDataformat,
credentialId: Option[String] = None)
credentialId: Option[String] = None) {
// Warning: throws! Use inside of tryo
def localPath: Path = {
if (path.getScheme.nonEmpty && path.getScheme != "file") {
throw new Exception(
"Trying to open non-local hdf5 file. Hdf5 files are only supported on the datastore-local file system.")
}
Path.of(path)
}
}

object LayerAttachment {
implicit val jsonFormat: Format[LayerAttachment] = Json.format[LayerAttachment]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import org.apache.commons.codec.digest.MurmurHash3

import java.nio.ByteBuffer

trait Hdf5HashedArrayUtils {

val hdf5FileExtension = "hdf5"
trait ArrayArtifactHashing {

def getHashFunction(name: String): Long => Long = name match {
case "identity" => identity
case "murmurhash3_x64_128" =>
x: Long =>
Math.abs(MurmurHash3.hash128x64(ByteBuffer.allocate(8).putLong(x).array())(1))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.typesafe.scalalogging.LazyLogging
import com.scalableminds.util.tools.{Box, Empty, Full}
import ucar.ma2.{Array => MultiArray}
import com.scalableminds.util.tools.Box.tryo
import com.scalableminds.webknossos.datastore.services.mapping.AgglomerateService

import java.nio.file.Path
import scala.concurrent.ExecutionContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.scalableminds.webknossos.datastore.services

import java.nio.file.Paths
import com.scalableminds.webknossos.datastore.DataStoreConfig
import com.scalableminds.webknossos.datastore.services.mapping.AgglomerateService
import com.scalableminds.webknossos.datastore.storage.RemoteSourceDescriptorService

import javax.inject.Inject
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.scalableminds.webknossos.datastore.services

import play.api.libs.json.{JsLookupResult, JsResult, JsValue}

trait VoxelyticsZarrArtifactUtils {

val FILENAME_ZARR_JSON = "zarr.json"

private val keyAttributes = "attributes"
private val keyVx = "voxelytics"
private val keyFormatVersion = "artifact_schema_version"
private val keyArtifactAttrs = "artifact_attributes"

protected def readArtifactSchemaVersion(zarrGroupJson: JsValue): JsResult[Long] =
(zarrGroupJson \ keyAttributes \ keyVx \ keyFormatVersion).validate[Long]

protected def lookUpArtifactAttributes(zarrGroupJson: JsValue): JsLookupResult =
zarrGroupJson \ keyAttributes \ keyVx \ keyArtifactAttrs

}
Loading