Skip to content

Commit

Permalink
allow creating tree groups even for single nml upload (#4563)
Browse files Browse the repository at this point in the history
* allow creating tree groups even for single nml upload

* update changelog
  • Loading branch information
youri-k authored Apr 23, 2020
1 parent a7a3ed1 commit be88e7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
- Deleting an empty tree group in the `Trees` tab no longer prompts for user confirmation. [#4506](https://github.com/scalableminds/webknossos/pull/4506)
- Toggling the "Render missing data black" option now automatically reloads all layers making it unnecessary to reload the whole page. [#4516](https://github.com/scalableminds/webknossos/pull/4516)
- The "mappings" attribute of segmentation layers in datasource jsons can now be omitted. [#4532](https://github.com/scalableminds/webknossos/pull/4532)
- Uploading a single nml, allows to wrap the tracing in a new tree group. [#4563](https://github.com/scalableminds/webknossos/pull/4563)

### Fixed
- Users only get tasks of datasets that they can access. [#4488](https://github.com/scalableminds/webknossos/pull/4488)
Expand Down
20 changes: 8 additions & 12 deletions app/models/annotation/nml/NmlService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,14 @@ class NmlService @Inject()(temporaryFileCreator: TemporaryFileCreator)(implicit
tracing.copy(trees = newTrees, treeGroups = newTreeGroups)
}

if (parseResults.length > 1) {
parseResults.map {
case NmlParseSuccess(name, Some(skeletonTracing), volumeTracingOpt, description, organizationNameOpt) =>
NmlParseSuccess(name,
Some(wrapTreesInGroup(name, skeletonTracing)),
volumeTracingOpt,
description,
organizationNameOpt)
case r => r
}
} else {
parseResults
parseResults.map {
case NmlParseSuccess(name, Some(skeletonTracing), volumeTracingOpt, description, organizationNameOpt) =>
NmlParseSuccess(name,
Some(wrapTreesInGroup(name, skeletonTracing)),
volumeTracingOpt,
description,
organizationNameOpt)
case r => r
}
}

Expand Down

0 comments on commit be88e7d

Please sign in to comment.