-
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
OME-Zarr NGFF v0.5 dataset exploration #8122
Conversation
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.
Nice! Works for me, and code mostly looks good :) I added just a few comments
...-datastore/app/com/scalableminds/webknossos/datastore/explore/ExploreLocalLayerService.scala
Show resolved
Hide resolved
Vec3Double(xFactors.product, yFactors.product, zFactors.product) | ||
} | ||
|
||
protected def getShape(dataset: NgffDataset, path: VaultPath): Fox[Array[Int]] = ??? |
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.
can the = ???
be removed? Then the compiler should check that all classes implementing the trait implement this.
nameFromPath = guessNameFromPath(remotePath) | ||
name = multiscale.name.getOrElse(nameFromPath) | ||
layerTuples <- Fox.serialCombined((0 until channelCount).toList)({ channelIndex: Int => | ||
for { |
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.
some of these functions have gotten pretty big. Maybe it would make sense to extract some parts into separate named functions? Maybe the nested for comprehensions are a good candidate.
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.
Create createLayers
additionalAxes = Some(additionalAxes), | ||
defaultViewConfiguration = Some(viewConfig), | ||
) | ||
} yield (layer, VoxelSize(voxelSizeFactor, unifiedAxisUnit)) |
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.
looks like there is still quite a bit of duplication between 0_5 and 0_4. I wonder if some more code could be extracted into functions to be moved into the new trait? But I might have overlooked some subtle differences.
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.
zarrMagFromNgffDataset needs to remain duplicated because it uses getZarrHeader, which returns differnt headers (case classes, so I don't think we can use a trait here).
But I moved a liitle more.
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.
Nice, much cleaner :) I also re-tested. Just one last little suggestion
fileAsString <- tryo(new String(fileBytes, StandardCharsets.UTF_8)).toFox ?~> "dataset.explore.failed.readFile" | ||
parsed <- JsonHelper.parseAndValidateJson[T](fileAsString) | ||
} yield parsed | ||
path.parseAsJson[T] |
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.
looks like this can be inlined now
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.
What do you mean by that?
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.
The function is a single line now, so I would suggest deleting the function and replacing all usages of parseJsonFromPath(path) directly by path.parseAsJson
URL of deployed dev instance (used for testing):
Since on GitHub the diff is very big: I renamed the NgffExplorer to NgffV0_4Explorer, created NgffV0_5Explorer, extracted common behavior to the NgffExplorationUtils.
Steps to test:
TODOs:
Issues:
(Please delete unneeded items, merge only when none are left open)