Skip to content

Commit

Permalink
When downloading with skipVolumeData, keep volume tag (#6566)
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 committed Nov 7, 2022
1 parent 604bf48 commit 45e97b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
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

0 comments on commit 45e97b6

Please sign in to comment.