-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N5 support #6466
N5 support #6466
Conversation
…r in simpler composition instead of inheritance
# Conflicts: # project/Dependencies.scala
Open questions:
|
If the ZarrDataType also works for N5, maybe you can come up with a good name and place for it so that it can be used for both with good conscience.
If that is relatively easy to do, I’d say yes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First scroll-through looks very promising :) I’ll review in more detail on monday, but the abstraction concept seems very nice!
Couple of naming suggestions:
FileSystemStoreN5 (and other things with N5 at the end) → N5FileSystemStore (I’d say it is nicer to have the most general at the end, this thing is a store, after all, not an n5)
resolvedDataType → dataType (is this a problem? you changed this for zarr)
chunkSize → chunkShape (size feels one-dimensional for me. now that we have this freedom, I’d go for shape, compare scalableminds/webknossos-libs#706)
What would be missing for users to add remote N5 dataset (e.g. https://janelia-cosem-datasets.s3.amazonaws.com/jrc_macrophage-2/jrc_macrophage-2.n5) in webKnossos? |
At the very least the ExploreRemoteLayer functionality (where we detect ngff headers and create datasource-properties.jsons from them) needs to be extended to explore N5 datasets as well. That is not yet part of this PR. Edit: I wrote #6480 for that |
Instead of putting the actual files on asterix, could also put a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this great PR! I really like that you took the time to think about how this can be integrated with the existing zarr reading code.
I added some more comments in addition to my renaming requests above :)
Also I’m looking forward to test this with remote datasets, and with multiple mags. (Maybe you could prepare a datasource-properties.json, as Norman already suggested?)
webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/DatasetPath.scala
Outdated
Show resolved
Hide resolved
...ssos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/jzarr/ZarrHeader.scala
Outdated
Show resolved
Hide resolved
webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/n5/N5DataType.scala
Show resolved
Hide resolved
webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/n5/N5Header.scala
Outdated
Show resolved
Hide resolved
webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/n5/N5DataType.scala
Outdated
Show resolved
Hide resolved
...ossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/jzarr/ZarrArray.scala
Outdated
Show resolved
Hide resolved
webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/Compressor.scala
Outdated
Show resolved
Hide resolved
...ssos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/n5/ChunkReaderN5.scala
Outdated
Show resolved
Hide resolved
...ssos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/n5/ChunkReaderN5.scala
Outdated
Show resolved
Hide resolved
lazy val pathWithFallback: String = | ||
path.getOrElse(if (mag.isIsotropic) s"${mag.x}" else s"${mag.x}-${mag.y}-${mag.z}") | ||
private lazy val uri: URI = new URI(pathWithFallback) | ||
private lazy val isRemote: Boolean = FileSystemsHolder.isSupportedRemoteScheme(uri.getScheme) | ||
lazy val remoteSource: Option[RemoteSourceDescriptor] = | ||
if (isRemote) | ||
Some(RemoteSourceDescriptor(uri, credentials.map(_.user), credentials.flatMap(_.password))) | ||
else | ||
None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads a lot like ZarrMag. Maybe there can be a common trait? Not sure about a good name, though, ExtendedMag? Maybe you have a better Idea :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly ZarrMag
. I went ahead and used hte new class in both cases (DatasetLocatorMag
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have better ideas for the name, feel free to share ;)
…e/datareaders/n5/ChunkReaderN5.scala Co-authored-by: Florian M <[email protected]>
This is actually a problem because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
DatasetArray
andDatasetHeader
whichZarrArray
,N5Array
,ZarrHeader
, andN5Header
subclass and adapt the corresponding specFileSystemStore
, (2) byCompressor
, and (3) byMultiArray
ChunkReader
composes those components so that they are easier to swap outURL of deployed dev instance (used for testing):
Steps to test:
Issues:
TODO
attribute.json
to also contain boolean valuesuint8