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

When downloading with skipVolumeData, keep volume tag #6566

Merged
merged 4 commits into from
Nov 7, 2022
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.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Node positions are always handled as integers. They have always been persisted as integers by the server, anyway, but the session in which a node was created handled the position as floating point in earlier versions. [#6589](https://github.com/scalableminds/webknossos/pull/6589)
- When merging annotations, bounding boxes are no longer duplicated. [#6576](https://github.com/scalableminds/webknossos/pull/6576)
- Jobs can no longer be started on datastores without workers. [#6595](https://github.com/scalableminds/webknossos/pull/6595)
- When downloading volume annotations with volume data skipped, the nml volume tag is now included anyway (but has no location attribute in this case). [#6566](https://github.com/scalableminds/webknossos/pull/6566)

### Fixed

Expand Down
28 changes: 14 additions & 14 deletions app/models/annotation/nml/NmlWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,21 @@ class NmlWriter @Inject()(implicit ec: ExecutionContext) extends FoxImplicits {
isSingle: Boolean,
volumeFilename: Option[String],
skipVolumeData: Boolean)(implicit writer: XMLStreamWriter): Unit =
if (skipVolumeData) {
writer.writeComment(
f"A volume layer named ${volumeLayer.name} (id = $index) was omitted here while downloading this annotation without volume data.")
} else {
Xml.withinElementSync("volume") {
writer.writeAttribute("id", index.toString)
Xml.withinElementSync("volume") {
writer.writeAttribute("id", index.toString)
writer.writeAttribute("name", volumeLayer.name)
if (!skipVolumeData) {
writer.writeAttribute("location", volumeFilename.getOrElse(volumeLayer.volumeDataZipName(index, isSingle)))
writer.writeAttribute("name", volumeLayer.name)
volumeLayer.tracing match {
case Right(volumeTracing) =>
volumeTracing.fallbackLayer.foreach(writer.writeAttribute("fallbackLayer", _))
volumeTracing.largestSegmentId.foreach(id => writer.writeAttribute("largestSegmentId", id.toString))
writeVolumeSegmentMetadata(volumeTracing.segments)
case _ => ()
}
}
volumeLayer.tracing match {
case Right(volumeTracing) =>
volumeTracing.fallbackLayer.foreach(writer.writeAttribute("fallbackLayer", _))
volumeTracing.largestSegmentId.foreach(id => writer.writeAttribute("largestSegmentId", id.toString))
if (skipVolumeData) {
writer.writeComment(f"Note that volume data was omitted when downloading this annotation.")
}
writeVolumeSegmentMetadata(volumeTracing.segments)
case _ => ()
}
}

Expand Down