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

Rename Resolution to Mag #8111

Merged
merged 45 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c4be79f
start to replace term resolution
knollengewaechs Oct 2, 2024
751d4f9
rename resolution to mag in backend where possible
fm3 Oct 8, 2024
58e75dd
rename resolution restrictions
knollengewaechs Oct 11, 2024
9b32b5f
rename resolution info to mag info
knollengewaechs Oct 12, 2024
e012803
rename in dataset accessor, a.o.
knollengewaechs Oct 12, 2024
f21b745
rename in frontend code
knollengewaechs Oct 12, 2024
ca6b25f
rename in docs
knollengewaechs Oct 12, 2024
6ec5cf5
rename node resolution to mag
knollengewaechs Oct 12, 2024
84e7333
adjust mag slider
knollengewaechs Oct 12, 2024
10a693d
fix tests
knollengewaechs Oct 12, 2024
7626df1
add explaining sentences
knollengewaechs Oct 12, 2024
d93c850
refresh snapshots
knollengewaechs Oct 14, 2024
bedf85c
improve explanation in info tab and status bar
knollengewaechs Oct 14, 2024
eaf7fec
adapt param name
knollengewaechs Oct 14, 2024
b9be934
merge master, with updated snapshots
knollengewaechs Oct 14, 2024
9be7f8b
remove application conf edits
knollengewaechs Oct 14, 2024
b7c4ecc
lint
knollengewaechs Oct 14, 2024
c6529a6
rename columns + table in sql, add migration
fm3 Oct 14, 2024
e9ba154
Merge branch 'master' into mag-all-the-way
fm3 Oct 14, 2024
89e267a
adapt test db after schema change
fm3 Oct 14, 2024
e88f070
changelog
fm3 Oct 14, 2024
3efbb44
slightly adjust changelog entry to lower expectations
knollengewaechs Oct 14, 2024
22beba0
adjust docs and revert some changes
knollengewaechs Oct 14, 2024
db09e99
adjust neuroglancer docs
knollengewaechs Oct 14, 2024
8b50f73
Update webknossos-tracingstore/app/com/scalableminds/webknossos/traci…
fm3 Oct 15, 2024
0ea1d8f
address review
knollengewaechs Oct 15, 2024
02b5d23
merge master
knollengewaechs Oct 16, 2024
d435fb3
fix previous version in db evolution
knollengewaechs Oct 16, 2024
8ed83b3
adjust version in schema.sql
knollengewaechs Oct 16, 2024
46e9619
also adapt schema version in reversion
fm3 Oct 16, 2024
8a839f8
Merge branch 'master' into mag-all-the-way
knollengewaechs Oct 17, 2024
68f58c9
adjust form names
knollengewaechs Oct 17, 2024
0a8b313
adjust get params for /createExplorational
knollengewaechs Oct 17, 2024
14ada37
remove unused messages
knollengewaechs Oct 17, 2024
e0797ee
Merge branch 'master' into mag-all-the-way
MichaelBuessemeyer Oct 17, 2024
4c47db5
debug nightly circleci image
hotzenklotz Oct 18, 2024
5c33252
fix keyboard shortcut links
hotzenklotz Oct 18, 2024
925127e
add nightly screenshot/puppeteer Github action stub
hotzenklotz Oct 18, 2024
7168c46
add a manual trigger for nightly action
hotzenklotz Oct 18, 2024
260ce74
Merge branch 'master' into mag-all-the-way
knollengewaechs Oct 18, 2024
00e4f34
merge master
knollengewaechs Oct 21, 2024
e5f8d93
Merge branch 'master' into mag-all-the-way
knollengewaechs Oct 21, 2024
dd7e85d
add whitespace
knollengewaechs Oct 21, 2024
19cfefa
format comment
knollengewaechs Oct 21, 2024
722b2d7
hopefully fix circleci config
fm3 Oct 21, 2024
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 @@ -15,6 +15,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Added a summary row to the time tracking overview, where times and annotations/tasks are summed. [#8092](https://github.com/scalableminds/webknossos/pull/8092)
- Most sliders have been improved: Wheeling above a slider now changes its value and double-clicking its knob resets it to its default value. [#8095](https://github.com/scalableminds/webknossos/pull/8095)
- Increased loading speed for precomputed meshes. [#8110](https://github.com/scalableminds/webknossos/pull/8110)
- Unified wording in UI and code: “Magnification”/“mag” is now used in place of “Resolution“ most of the time, compare [https://docs.webknossos.org/webknossos/terminology.html](terminology document). [#8111](https://github.com/scalableminds/webknossos/pull/8111)

### Changed
- Some mesh-related actions were disabled in proofreading-mode when using meshfiles that were created for a mapping rather than an oversegmentation. [#8091](https://github.com/scalableminds/webknossos/pull/8091)
Expand Down
1 change: 1 addition & 0 deletions MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
### Postgres Evolutions:

- [121-worker-name.sql](conf/evolutions/121-worker-name.sql)
- [122-resolution-to-mag.sql](conf/evolutions/122-resolution-to-mag.sql)
4 changes: 2 additions & 2 deletions app/controllers/AnnotationController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.scalableminds.webknossos.datastore.models.annotation.{
}
import com.scalableminds.webknossos.datastore.models.datasource.AdditionalAxis
import com.scalableminds.webknossos.datastore.rpc.RPC
import com.scalableminds.webknossos.tracingstore.tracings.volume.ResolutionRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.volume.MagRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.{TracingIds, TracingType}
import mail.{MailchimpClient, MailchimpTag}
import models.analytics.{AnalyticsService, CreateAnnotationEvent, OpenAnnotationEvent}
Expand Down Expand Up @@ -44,7 +44,7 @@ case class AnnotationLayerParameters(typ: AnnotationLayerType,
fallbackLayerName: Option[String],
autoFallbackLayer: Boolean = false,
mappingName: Option[String] = None,
resolutionRestrictions: Option[ResolutionRestrictions],
magRestrictions: Option[MagRestrictions],
name: Option[String],
additionalAxes: Option[Seq[AdditionalAxis]])
object AnnotationLayerParameters {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/AnnotationIOController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class AnnotationIOController @Inject()(
largestSegmentId =
annotationService.combineLargestSegmentIdsByPrecedence(volumeTracing.largestSegmentId,
fallbackLayerOpt.map(_.largestSegmentId)),
resolutions = VolumeTracingDownsampling.magsForVolumeTracing(dataSource, fallbackLayerOpt).map(vec3IntToProto),
mags = VolumeTracingDownsampling.magsForVolumeTracing(dataSource, fallbackLayerOpt).map(vec3IntToProto),
hasSegmentIndex = Some(tracingCanHaveSegmentIndex)
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/LegacyApiController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import play.silhouette.api.actions.SecuredRequest
import com.scalableminds.util.tools.Fox
import com.scalableminds.webknossos.datastore.models.VoxelSize
import com.scalableminds.webknossos.datastore.models.annotation.{AnnotationLayer, AnnotationLayerType}
import com.scalableminds.webknossos.tracingstore.tracings.volume.ResolutionRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.volume.MagRestrictions
import models.dataset.DatasetService
import models.organization.OrganizationDAO

Expand All @@ -24,7 +24,7 @@ import scala.concurrent.ExecutionContext

case class LegacyCreateExplorationalParameters(typ: String,
fallbackLayerName: Option[String],
resolutionRestrictions: Option[ResolutionRestrictions])
resolutionRestrictions: Option[MagRestrictions])
object LegacyCreateExplorationalParameters {
implicit val jsonFormat: OFormat[LegacyCreateExplorationalParameters] =
Json.format[LegacyCreateExplorationalParameters]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/TaskTypeController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class TaskTypeController @Inject()(taskTypeDAO: TaskTypeDAO,
taskTypeIdValidated <- ObjectId.fromString(taskTypeId) ?~> "taskType.id.invalid"
taskType <- taskTypeDAO.findOne(taskTypeIdValidated) ?~> "taskType.notFound" ~> NOT_FOUND
_ <- bool2Fox(taskTypeFromForm.tracingType == taskType.tracingType) ?~> "taskType.tracingTypeImmutable"
_ <- bool2Fox(taskTypeFromForm.settings.resolutionRestrictions == taskType.settings.resolutionRestrictions) ?~> "taskType.resolutionRestrictionsImmutable"
_ <- bool2Fox(taskTypeFromForm.settings.magRestrictions == taskType.settings.magRestrictions) ?~> "taskType.magRestrictionsImmutable"
updatedTaskType = taskTypeFromForm.copy(_id = taskType._id)
_ <- Fox.assertTrue(userService.isTeamManagerOrAdminOf(request.identity, taskType._team)) ?~> "notAllowed" ~> FORBIDDEN
_ <- Fox
Expand Down
35 changes: 17 additions & 18 deletions app/models/annotation/AnnotationService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.scalableminds.webknossos.datastore.rpc.RPC
import com.scalableminds.webknossos.tracingstore.tracings._
import com.scalableminds.webknossos.tracingstore.tracings.volume.VolumeDataZipFormat.VolumeDataZipFormat
import com.scalableminds.webknossos.tracingstore.tracings.volume.{
ResolutionRestrictions,
MagRestrictions,
VolumeDataZipFormat,
VolumeTracingDefaults,
VolumeTracingDownsampling
Expand Down Expand Up @@ -144,15 +144,15 @@ class AnnotationService @Inject()(
boundingBox: Option[BoundingBox] = None,
startPosition: Option[Vec3Int] = None,
startRotation: Option[Vec3Double] = None,
resolutionRestrictions: ResolutionRestrictions,
magRestrictions: MagRestrictions,
mappingName: Option[String]
): Fox[VolumeTracing] = {
val resolutions = VolumeTracingDownsampling.magsForVolumeTracing(dataSource, fallbackLayer)
val resolutionsRestricted = resolutionRestrictions.filterAllowed(resolutions)
val mags = VolumeTracingDownsampling.magsForVolumeTracing(dataSource, fallbackLayer)
val magsRestricted = magRestrictions.filterAllowed(mags)
val additionalAxes =
fallbackLayer.map(_.additionalAxes).getOrElse(dataSource.additionalAxesUnion)
for {
_ <- bool2Fox(resolutionsRestricted.nonEmpty) ?~> "annotation.volume.resolutionRestrictionsTooTight"
_ <- bool2Fox(magsRestricted.nonEmpty) ?~> "annotation.volume.magRestrictionsTooTight"
remoteDatastoreClient = new WKRemoteDataStoreClient(datasetDataStore, rpc)
fallbackLayerHasSegmentIndex <- fallbackLayer match {
case Some(layer) =>
Expand All @@ -175,7 +175,7 @@ class AnnotationService @Inject()(
VolumeTracingDefaults.zoomLevel,
organizationId = Some(datasetOrganizationId),
mappingName = mappingName,
resolutions = resolutionsRestricted.map(vec3IntToProto),
mags = magsRestricted.map(vec3IntToProto),
hasSegmentIndex = Some(fallbackLayer.isEmpty || fallbackLayerHasSegmentIndex),
additionalAxes = AdditionalAxis.toProto(additionalAxes)
)
Expand Down Expand Up @@ -286,8 +286,7 @@ class AnnotationService @Inject()(
datasetOrganizationId,
dataStore,
fallbackLayer,
resolutionRestrictions =
annotationLayerParameters.resolutionRestrictions.getOrElse(ResolutionRestrictions.empty),
magRestrictions = annotationLayerParameters.magRestrictions.getOrElse(MagRestrictions.empty),
mappingName = annotationLayerParameters.mappingName
)
volumeTracingAdapted = oldPrecedenceLayerProperties.map { p =>
Expand Down Expand Up @@ -417,7 +416,7 @@ class AnnotationService @Inject()(
usedFallbackLayerName,
autoFallbackLayer = false,
None,
Some(ResolutionRestrictions.empty),
Some(MagRestrictions.empty),
Some(AnnotationLayer.defaultNameForType(newAnnotationLayerType)),
None
)
Expand Down Expand Up @@ -551,14 +550,14 @@ class AnnotationService @Inject()(
)
}

def createVolumeTracingBase(datasetName: String,
organizationId: String,
boundingBox: Option[BoundingBox],
startPosition: Vec3Int,
startRotation: Vec3Double,
volumeShowFallbackLayer: Boolean,
resolutionRestrictions: ResolutionRestrictions)(implicit ctx: DBAccessContext,
m: MessagesProvider): Fox[VolumeTracing] =
def createVolumeTracingBase(
datasetName: String,
organizationId: String,
boundingBox: Option[BoundingBox],
startPosition: Vec3Int,
startRotation: Vec3Double,
volumeShowFallbackLayer: Boolean,
magRestrictions: MagRestrictions)(implicit ctx: DBAccessContext, m: MessagesProvider): Fox[VolumeTracing] =
for {
organization <- organizationDAO.findOne(organizationId)
dataset <- datasetDAO.findOneByNameAndOrganization(datasetName, organizationId) ?~> Messages("dataset.notFound",
Expand All @@ -583,7 +582,7 @@ class AnnotationService @Inject()(
},
startPosition = Some(startPosition),
startRotation = Some(startRotation),
resolutionRestrictions = resolutionRestrictions,
magRestrictions = magRestrictions,
mappingName = None
)
} yield volumeTracing
Expand Down
4 changes: 2 additions & 2 deletions app/models/annotation/AnnotationSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package models.annotation
import com.scalableminds.util.enumeration.ExtendedEnumeration
import com.scalableminds.webknossos.tracingstore.tracings.TracingType
import com.scalableminds.webknossos.tracingstore.tracings.TracingType.TracingType
import com.scalableminds.webknossos.tracingstore.tracings.volume.ResolutionRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.volume.MagRestrictions
import play.api.libs.json._

object TracingMode extends ExtendedEnumeration {
Expand All @@ -18,7 +18,7 @@ case class AnnotationSettings(
somaClickingAllowed: Boolean = true,
volumeInterpolationAllowed: Boolean = true,
mergerMode: Boolean = false,
resolutionRestrictions: ResolutionRestrictions = ResolutionRestrictions.empty
magRestrictions: MagRestrictions = MagRestrictions.empty
)

object AnnotationSettings {
Expand Down
14 changes: 7 additions & 7 deletions app/models/annotation/WKRemoteTracingStoreClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.scalableminds.webknossos.datastore.models.annotation.{
import com.scalableminds.webknossos.datastore.models.datasource.DataSourceLike
import com.scalableminds.webknossos.datastore.rpc.RPC
import com.scalableminds.webknossos.tracingstore.tracings.TracingSelector
import com.scalableminds.webknossos.tracingstore.tracings.volume.ResolutionRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.volume.MagRestrictions
import com.scalableminds.webknossos.tracingstore.tracings.volume.VolumeDataZipFormat.VolumeDataZipFormat
import com.typesafe.scalalogging.LazyLogging
import controllers.RpcTokenHolder
Expand Down Expand Up @@ -100,7 +100,7 @@ class WKRemoteTracingStoreClient(
def duplicateVolumeTracing(volumeTracingId: String,
isFromTask: Boolean = false,
datasetBoundingBox: Option[BoundingBox] = None,
resolutionRestrictions: ResolutionRestrictions = ResolutionRestrictions.empty,
magRestrictions: MagRestrictions = MagRestrictions.empty,
downsample: Boolean = false,
editPosition: Option[Vec3Int] = None,
editRotation: Option[Vec3Double] = None,
Expand All @@ -109,8 +109,8 @@ class WKRemoteTracingStoreClient(
rpc(s"${tracingStore.url}/tracings/volume/$volumeTracingId/duplicate").withLongTimeout
.addQueryString("token" -> RpcTokenHolder.webknossosToken)
.addQueryString("fromTask" -> isFromTask.toString)
.addQueryStringOptional("minResolution", resolutionRestrictions.minStr)
.addQueryStringOptional("maxResolution", resolutionRestrictions.maxStr)
.addQueryStringOptional("minMag", magRestrictions.minStr)
.addQueryStringOptional("maxMag", magRestrictions.maxStr)
.addQueryStringOptional("editPosition", editPosition.map(_.toUriLiteral))
.addQueryStringOptional("editRotation", editRotation.map(_.toUriLiteral))
.addQueryStringOptional("boundingBox", boundingBox.map(_.toLiteral))
Expand Down Expand Up @@ -173,7 +173,7 @@ class WKRemoteTracingStoreClient(

def saveVolumeTracing(tracing: VolumeTracing,
initialData: Option[File] = None,
resolutionRestrictions: ResolutionRestrictions = ResolutionRestrictions.empty,
magRestrictions: MagRestrictions = MagRestrictions.empty,
dataSource: Option[DataSourceLike] = None): Fox[String] = {
logger.debug("Called to create VolumeTracing." + baseInfo)
for {
Expand All @@ -185,8 +185,8 @@ class WKRemoteTracingStoreClient(
case Some(file) =>
rpc(s"${tracingStore.url}/tracings/volume/$tracingId/initialData").withLongTimeout
.addQueryString("token" -> RpcTokenHolder.webknossosToken)
.addQueryStringOptional("minResolution", resolutionRestrictions.minStr)
.addQueryStringOptional("maxResolution", resolutionRestrictions.maxStr)
.addQueryStringOptional("minMag", magRestrictions.minStr)
.addQueryStringOptional("maxMag", magRestrictions.maxStr)
.post(file)
case _ =>
Fox.successful(())
Expand Down
19 changes: 5 additions & 14 deletions app/models/annotation/nml/NmlParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object NmlParser extends LazyLogging with ProtoGeometryImplicits with ColorGener

private val DEFAULT_TIME = 0L
private val DEFAULT_VIEWPORT = 0
private val DEFAULT_RESOLUTION = 0
private val DEFAULT_MAG = 0
private val DEFAULT_BITDEPTH = 0
private val DEFAULT_DESCRIPTION = ""
private val DEFAULT_INTERPOLATION = false
Expand Down Expand Up @@ -519,8 +519,8 @@ object NmlParser extends LazyLogging with ProtoGeometryImplicits with ColorGener
private def parseViewport(node: XMLNode) =
getSingleAttribute(node, "inVp").toIntOpt.getOrElse(DEFAULT_VIEWPORT)

private def parseResolution(node: XMLNode) =
getSingleAttribute(node, "inMag").toIntOpt.getOrElse(DEFAULT_RESOLUTION)
private def parseMag(node: XMLNode) =
getSingleAttribute(node, "inMag").toIntOpt.getOrElse(DEFAULT_MAG)

private def parseBitDepth(node: XMLNode) =
getSingleAttribute(node, "bitDepth").toIntOpt.getOrElse(DEFAULT_BITDEPTH)
Expand All @@ -540,21 +540,12 @@ object NmlParser extends LazyLogging with ProtoGeometryImplicits with ColorGener
position <- parseVec3Int(node) ?~ Messages("nml.node.attribute.invalid", "position", id)
} yield {
val viewport = parseViewport(node)
val resolution = parseResolution(node)
val mag = parseMag(node)
val timestamp = parseTimestamp(node)
val bitDepth = parseBitDepth(node)
val interpolation = parseInterpolation(node)
val rotation = parseRotationForNode(node).getOrElse(NodeDefaults.rotation)
Node(id,
position,
rotation,
radius,
viewport,
resolution,
bitDepth,
interpolation,
timestamp,
additionalCoordinates)
Node(id, position, rotation, radius, viewport, mag, bitDepth, interpolation, timestamp, additionalCoordinates)
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/models/annotation/nml/NmlWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class NmlWriter @Inject()(implicit ec: ExecutionContext) extends FoxImplicits {
writer.writeAttribute("rotY", n.rotation.y.toString)
writer.writeAttribute("rotZ", n.rotation.z.toString)
writer.writeAttribute("inVp", n.viewport.toString)
writer.writeAttribute("inMag", n.resolution.toString)
writer.writeAttribute("inMag", n.mag.toString)
writer.writeAttribute("bitDepth", n.bitDepth.toString)
writer.writeAttribute("interpolation", n.interpolation.toString)
writer.writeAttribute("time", n.createdTimestamp.toString)
Expand Down
Loading