Skip to content

Commit

Permalink
Multi-NML Upload: allow for only some to have Orga Attribute (#5483)
Browse files Browse the repository at this point in the history
* Multi-NML Upload: allow for only some to have Orga Attribute

* avoid .head
  • Loading branch information
fm3 authored May 11, 2021
1 parent 7f96874 commit ab6be10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Added an icon to the info tab of a tracing that links to the dataset settings. It's located next to the dataset name. [#4772](https://github.com/scalableminds/webknossos/pull/5462)

### Changed
-
-

### Fixed
- Fixed that the row selection in the user table wasn't properly preserved when filtering the table and (un)selecting rows. [#5486](https://github.com/scalableminds/webknossos/pull/5486)
- Fixed a bug where histograms generation failed for tiny datasets. [#5458](https://github.com/scalableminds/webknossos/pull/5458)
- Fixed a bug where the upload of multiple NMLs failed if some of them have an organization attribute and others don’t. [#5483](https://github.com/scalableminds/webknossos/pull/5483)

### Removed
- Removed the button to load or refresh the isosurface of the centered cell from the 3D view. Instead, this action can be triggered from the "Meshes" tab. [#5440](https://github.com/scalableminds/webknossos/pull/5440)
Expand Down
14 changes: 6 additions & 8 deletions app/controllers/AnnotationIOController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,13 @@ class AnnotationIOController @Inject()(nmlWriter: NmlWriter,
} yield dataSetName

private def assertAllOnSameOrganization(skeletons: List[SkeletonTracing],
volumes: List[VolumeTracing]): Fox[Option[String]] =
volumes: List[VolumeTracing]): Fox[Option[String]] = {
// Note that organizationNames are optional. Tracings with no organization attribute are ignored here
val organizationNames = skeletons.flatMap(_.organizationName) ::: volumes.flatMap(_.organizationName)
for {
organizationName: Option[String] <- volumes.headOption
.map(_.organizationName)
.orElse(skeletons.headOption.map(_.organizationName))
.toFox
_ <- bool2Fox(skeletons.forall(_.organizationName == organizationName))
_ <- bool2Fox(volumes.forall(_.organizationName == organizationName))
} yield organizationName
_ <- Fox.runOptional(organizationNames.headOption)(name => bool2Fox(organizationNames.forall(_ == name)))
} yield organizationNames.headOption
}

private def adaptPropertiesToFallbackLayer(volumeTracing: VolumeTracing, dataSet: DataSet): Fox[VolumeTracing] =
for {
Expand Down

0 comments on commit ab6be10

Please sign in to comment.