Skip to content

Commit

Permalink
Fix NGFF import for datasets with no channel axis (#6637)
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 authored Nov 12, 2022
1 parent 35c3673 commit f3d6f07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit f3d6f07

Please sign in to comment.