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

allow creating tree groups even for single nml upload #4563

Merged
merged 2 commits into from
Apr 23, 2020
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.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