Skip to content
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

Fix NGFF import for datasets with no channel axis #6637

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed importing a dataset from disk. [#6615](https://github.com/scalableminds/webknossos/pull/6615)
- Fixed a bug in the dataset import view, where the layer name text field would lose focus after each key press. [#6615](https://github.com/scalableminds/webknossos/pull/6615)
- Fixed importing NGFF Zarr datasets with non-scale transforms. [#6621](https://github.com/scalableminds/webknossos/pull/6621)
- Fixed a regression in NGFF Zarr import for datasets with no channel axis. [#6636](https://github.com/scalableminds/webknossos/pull/6636)

### Removed

Expand Down
7 changes: 5 additions & 2 deletions app/models/binary/explore/NgffExplorer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ class NgffExplorer extends RemoteLayerExplorer {
zarrayPath = magPath.resolve(ZarrHeader.FILENAME_DOT_ZARRAY)
zarrHeader <- parseJsonFromPath[ZarrHeader](zarrayPath) ?~> s"failed to read zarr header at $zarrayPath"
axisOrder <- extractAxisOrder(multiscale.axes) ?~> "Could not extract XYZ axis order mapping. Does the data have x, y and z axes, stated in multiscales metadata?"
channelAxisIndex <- axisOrder.c.toFox
} yield zarrHeader.shape(channelAxisIndex)
channelCount = axisOrder.c match {
case Some(channeAxislIndex) => zarrHeader.shape(channeAxislIndex)
case _ => 1
}
} yield channelCount

private def layersFromNgffMultiscale(multiscale: NgffMultiscalesItem,
remotePath: Path,
Expand Down