Skip to content

Commit

Permalink
Fix edge cases in NGFF dataset upload (#8341)
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth authored Jan 20, 2025
1 parent d71e780 commit be83f8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed the template for neuron inferral using a custom workflow. [#8312](https://github.com/scalableminds/webknossos/pull/8312)
- Fixed that the list of processing jobs crashed for deleted job types. [#8300](https://github.com/scalableminds/webknossos/pull/8300)
- Fixed an issue where you could not maximize or reposition the 3D/XZ viewport in Safari. [#8337](https://github.com/scalableminds/webknossos/pull/8337)
- Fixed upload of NGFF datasets with only one directory named "color". [#8341](https://github.com/scalableminds/webknossos/pull/8341/)
- Fixed an issue that could occur if the NGFF multiscale name was set to "/" when exploring. [#8341](https://github.com/scalableminds/webknossos/pull/8341/)

### Removed
- Removed support for HTTP API versions 3 and 4. [#8075](https://github.com/scalableminds/webknossos/pull/8075)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ class ExploreLocalLayerService @Inject()(dataVaultService: DataVaultService)
explorer: RemoteLayerExplorer)(path: Path, dataSourceId: DataSourceId, layerDirectory: String)(
implicit ec: ExecutionContext): Fox[DataSourceWithMagLocators] =
for {
fullPath <- Fox.successful(path.resolve(layerDirectory))
_ <- Fox.successful(())
layer = if (layerDirectory.isEmpty) {
val subdirs = Files.list(path).iterator().asScala.toList
if (subdirs.size == 1) subdirs.head.getFileName.toString else layerDirectory
} else layerDirectory
fullPath <- Fox.successful(path.resolve(layer))
remoteSourceDescriptor <- Fox.successful(RemoteSourceDescriptor(fullPath.toUri, None))
vaultPath <- dataVaultService.getVaultPath(remoteSourceDescriptor) ?~> "dataVault.setup.failed"
layersWithVoxelSizes <- explorer.explore(vaultPath, None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ trait NgffExplorationUtils extends FoxImplicits {
axisOrder) ?~> "Could not extract voxel size from scale transforms"
voxelSizeFactor = voxelSizeInAxisUnits * axisUnitFactors
nameFromPath = remotePath.basename
datasetName = multiscale.name.getOrElse(nameFromPath)
datasetName = multiscale.name.flatMap(TextUtils.normalizeStrong).getOrElse(nameFromPath)
layers <- Fox.serialCombined((0 until channelCount).toList)({ channelIndex: Int =>
createLayer(remotePath,
credentialId,
Expand Down

0 comments on commit be83f8e

Please sign in to comment.