Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scalableminds/webknossos into dro…
Browse files Browse the repository at this point in the history
…pdown-menu

* 'master' of github.com:scalableminds/webknossos:
  Fix download button for annotations when tiff export is disabled (#6931)
  Update PULL_REQUEST_TEMPLATE.md
  Prepare multi modality support (#6748)
  Improvements for terms-of-services modal (#6930)
  Fix creating task types with preferred mode (#6928)
  Fix styling for login pages for dark mode users (#6916)
  Added members to admin team page (#6915)
  Release 23.03.1 (#6917)
  Redesign Welcome UI (#6904)
  Fix race condition which could disable saving (#6914)
  • Loading branch information
hotzenklotz committed Mar 20, 2023
2 parents 2dc8aa1 + a5dca07 commit 0879f2e
Show file tree
Hide file tree
Showing 133 changed files with 4,081 additions and 2,022 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ jobs:
- run:
name: Run screenshot-tests
command: |
# CircleCI cancels the job after 60 minutes. To ensure that screenshots are still
# uploaded as artifacts, we define a timeout of 50 minutes for the screenshot tests.
URL=https://master.webknossos.xyz/ \
timeout 3000 \
yarn test-screenshot
- store_artifacts:
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- [ ] Updated [changelog](../blob/master/CHANGELOG.unreleased.md#unreleased)
- [ ] Updated [migration guide](../blob/master/MIGRATIONS.unreleased.md#unreleased) if applicable
- [ ] Updated [documentation](../blob/master/docs) if applicable
- [ ] Adapted [wk-connect](https://github.com/scalableminds/webknossos-connect) if datastore API changes
- [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change
- [ ] Removed dev-only changes like prints and application.conf edits
- [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md)
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.released.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
For upgrade instructions, please check the [migration guide](MIGRATIONS.released.md).

## [23.03.1](https://github.com/scalableminds/webknossos/releases/tag/23.03.1) - 2023-03-14
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.0...23.03.1)

### Added
- Added support for remote Zarr datasets with a `datasource-properties.json` as created by the WEBKNOSSOS Python library. [#6879](https://github.com/scalableminds/webknossos/pull/6879)

### Changed
- Upgraded antd UI library to v4.24.8 [#6865](https://github.com/scalableminds/webknossos/pull/6865)
- The view mode dropdown was slimmed down by using icons to make the toolbar more space efficient. [#6900](https://github.com/scalableminds/webknossos/pull/6900)

### Fixed
- Fixed a bug where N5 datasets reading with end-chunks that have a chunk size differing from the metadata-supplied chunk size would fail for some areas. [#6890](https://github.com/scalableminds/webknossos/pull/6890)
- Fixed potential crash when trying to edit certain annotation properties of a shared annotation. [#6892](https://github.com/scalableminds/webknossos/pull/6892)
- Fixed a bug where merging multiple volume annotations would result in inconsistent segment lists. [#6882](https://github.com/scalableminds/webknossos/pull/6882)
- Fixed a bug where uploading multiple annotations with volume layers at once would fail. [#6882](https://github.com/scalableminds/webknossos/pull/6882)
- Fixed a bug where dates were formatted incorrectly in Voxelytics reports. [#6908](https://github.com/scalableminds/webknossos/pull/6908)
- Fixed a rare bug which could cause an incorrectly initialized annotation so that changes were not saved in the current session. [#6914](https://github.com/scalableminds/webknossos/pull/6914)

## [23.03.0](https://github.com/scalableminds/webknossos/releases/tag/23.03.0) - 2023-02-28
[Commits](https://github.com/scalableminds/webknossos/compare/23.02.1...23.03.0)

Expand Down
21 changes: 10 additions & 11 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ and this project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MIC
For upgrade instructions, please check the [migration guide](MIGRATIONS.released.md).

## Unreleased
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.0...HEAD)
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.1...HEAD)

### Added
- Added support for remote Zarr datasets with a `datasource-properties.json` as created by the WEBKNOSSOS Python library. [#6879](https://github.com/scalableminds/webknossos/pull/6879)
- Added support for datasets where layers are transformed individually (with an affine matrix). Transformations can be specified via datasource-properties.json or via JS API (will be ephemeral, then). [#6748](https://github.com/scalableminds/webknossos/pull/6748)
- Added list of all respective team members to the administration page for teams. [#6915](https://github.com/scalableminds/webknossos/pull/6915)

### Changed
- Upgraded antd UI library to v4.24.8 [#6865](https://github.com/scalableminds/webknossos/pull/6865)
- The view mode dropdown was slimmed down by using icons to make the toolbar more space efficient. [#6900](https://github.com/scalableminds/webknossos/pull/6900)
- Interpolation during rendering is now more performance intensive, since the rendering approach was changed. Therefore, interpolation is disabled by default. On the flip side, the rendered quality is often higher than it used to be. [#6748](https://github.com/scalableminds/webknossos/pull/6748)
- Updated the styling of the "welcome" screen for new users to be in line with the new branding. [#6904](https://github.com/scalableminds/webknossos/pull/6904)
- Improved Terms-of-Service modal (e.g., allow to switch organization even when modal was blocking the remaining usage of WEBKNOSSOS). [#6930](https://github.com/scalableminds/webknossos/pull/6930)

### Fixed
- Fixed a bug where N5 datasets reading with end-chunks that have a chunk size differing from the metadata-supplied chunk size would fail for some areas. [#6890](https://github.com/scalableminds/webknossos/pull/6890)
- Fixed potential crash when trying to edit certain annotation properties of a shared annotation. [#6892](https://github.com/scalableminds/webknossos/pull/6892)
- Fixed a bug where merging multiple volume annotations would result in inconsistent segment lists. [#6882](https://github.com/scalableminds/webknossos/pull/6882)
- Fixed a bug where uploading multiple annotations with volume layers at once would fail. [#6882](https://github.com/scalableminds/webknossos/pull/6882)
- Fixed a bug where dates were formatted incorrectly in Voxelytics reports. [#6908](https://github.com/scalableminds/webknossos/pull/6908)
- Fix antd deprecation warning for Dropdown menus. [#6898](https://github.com/scalableminds/webknossos/pull/6898)

- Fixed an issue with text hints not being visible on the logout page for dark mode users. [#6916](https://github.com/scalableminds/webknossos/pull/6916)
- Fixed creating task types with a selected preferred mode. [#6928](https://github.com/scalableminds/webknossos/pull/6928)
- Fixed download button for annotations which was disabled in some cases. [#6931](https://github.com/scalableminds/webknossos/pull/6931)
- Fixed antd deprecation warning for Dropdown menus. [#6898](https://github.com/scalableminds/webknossos/pull/6898)
### Removed

### Breaking Changes
9 changes: 8 additions & 1 deletion MIGRATIONS.released.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ See `MIGRATIONS.unreleased.md` for the changes which are not yet part of an offi
This project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
User-facing changes are documented in the [changelog](CHANGELOG.released.md).

## [23.03.1](https://github.com/scalableminds/webknossos/releases/tag/23.03.1) - 2023-03-14
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.0...23.03.1)
- WEBKNOSSOS now requires at least Java 11 (up from Java 8). [#6869](https://github.com/scalableminds/webknossos/pull/6869)

### Postgres Evolutions:
None.

## [23.03.0](https://github.com/scalableminds/webknossos/releases/tag/23.03.0) - 2023-02-28
[Commits](https://github.com/scalableminds/webknossos/compare/23.02.1...23.03.0)

Expand Down Expand Up @@ -529,4 +536,4 @@ No migrations necessary.


## [18.07.0](https://github.com/scalableminds/webknossos/releases/tag/18.07.0) - 2018-07-05
First release
First release
3 changes: 1 addition & 2 deletions MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
User-facing changes are documented in the [changelog](CHANGELOG.released.md).

## Unreleased
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.0...HEAD)
- WEBKNOSSOS now requires at least Java 11 (up from Java 8). [#6869](https://github.com/scalableminds/webknossos/pull/6869)
[Commits](https://github.com/scalableminds/webknossos/compare/23.03.1...HEAD)

### Postgres Evolutions:
2 changes: 1 addition & 1 deletion app/models/annotation/AnnotationSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object TracingMode extends ExtendedEnumeration {

case class AnnotationSettings(
allowedModes: List[TracingMode.Value],
preferredMode: Option[String] = None,
preferredMode: Option[TracingMode.Value] = None,
branchPointsAllowed: Boolean = true,
somaClickingAllowed: Boolean = true,
volumeInterpolationAllowed: Boolean = true,
Expand Down
85 changes: 71 additions & 14 deletions app/models/binary/DataSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import com.scalableminds.webknossos.datastore.models.datasource.{
AbstractDataLayer,
AbstractSegmentationLayer,
Category,
CoordinateTransformation,
CoordinateTransformationType,
ElementClass,
DataLayerLike => DataLayer
}
Expand Down Expand Up @@ -592,17 +594,13 @@ class DataSetResolutionsDAO @Inject()(sqlClient: SqlClient)(implicit ec: Executi

def updateResolutions(dataSetId: ObjectId, dataLayersOpt: Option[List[DataLayer]]): Fox[Unit] = {
val clearQuery = q"delete from webknossos.dataSet_resolutions where _dataSet = $dataSetId".asUpdate
val insertQueries = dataLayersOpt match {
case Some(dataLayers: List[DataLayer]) =>
dataLayers.flatMap { layer =>
layer.resolutions.map { resolution: Vec3Int =>
{
q"""insert into webknossos.dataSet_resolutions(_dataSet, dataLayerName, resolution)
values($dataSetId, ${layer.name}, $resolution)""".asUpdate
}
}
val insertQueries = dataLayersOpt.getOrElse(List.empty).flatMap { layer: DataLayer =>
layer.resolutions.map { resolution: Vec3Int =>
{
q"""insert into webknossos.dataSet_resolutions(_dataSet, dataLayerName, resolution)
values($dataSetId, ${layer.name}, $resolution)""".asUpdate
}
case _ => List()
}
}
for {
_ <- run(
Expand All @@ -615,8 +613,10 @@ class DataSetResolutionsDAO @Inject()(sqlClient: SqlClient)(implicit ec: Executi

}

class DataSetDataLayerDAO @Inject()(sqlClient: SqlClient, dataSetResolutionsDAO: DataSetResolutionsDAO)(
implicit ec: ExecutionContext)
class DataSetDataLayerDAO @Inject()(
sqlClient: SqlClient,
dataSetResolutionsDAO: DataSetResolutionsDAO,
datasetCoordinateTransformationsDAO: DatasetCoordinateTransformationsDAO)(implicit ec: ExecutionContext)
extends SimpleSQLDAO(sqlClient) {

private def parseRow(row: DatasetLayersRow, dataSetId: ObjectId): Fox[DataLayer] = {
Expand All @@ -631,6 +631,9 @@ class DataSetDataLayerDAO @Inject()(sqlClient: SqlClient, dataSetResolutionsDAO:
JsonHelper.parseAndValidateJson[LayerViewConfiguration](_))
adminViewConfigurationOpt <- Fox.runOptional(row.adminviewconfiguration)(
JsonHelper.parseAndValidateJson[LayerViewConfiguration](_))
coordinateTransformations <- datasetCoordinateTransformationsDAO.findCoordinateTransformationsForLayer(dataSetId,
row.name)
coordinateTransformationsOpt = if (coordinateTransformations.isEmpty) None else Some(coordinateTransformations)
} yield {
category match {
case Category.segmentation =>
Expand All @@ -645,7 +648,8 @@ class DataSetDataLayerDAO @Inject()(sqlClient: SqlClient, dataSetResolutionsDAO:
row.largestsegmentid,
mappingsAsSet.flatMap(m => if (m.isEmpty) None else Some(m)),
defaultViewConfigurationOpt,
adminViewConfigurationOpt
adminViewConfigurationOpt,
coordinateTransformationsOpt
))
case Category.color =>
Fox.successful(
Expand All @@ -656,7 +660,8 @@ class DataSetDataLayerDAO @Inject()(sqlClient: SqlClient, dataSetResolutionsDAO:
resolutions.sortBy(_.maxDim),
elementClass,
defaultViewConfigurationOpt,
adminViewConfigurationOpt
adminViewConfigurationOpt,
coordinateTransformationsOpt
))
case _ => Fox.failure(s"Could not match dataset layer with category $category")
}
Expand Down Expand Up @@ -710,6 +715,8 @@ class DataSetDataLayerDAO @Inject()(sqlClient: SqlClient, dataSetResolutionsDAO:
for {
_ <- run(DBIO.sequence(queries))
_ <- dataSetResolutionsDAO.updateResolutions(dataSetId, source.toUsable.map(_.dataLayers))
_ <- datasetCoordinateTransformationsDAO.updateCoordinateTransformations(dataSetId,
source.toUsable.map(_.dataLayers))
} yield ()
}

Expand Down Expand Up @@ -746,3 +753,53 @@ class DataSetLastUsedTimesDAO @Inject()(sqlClient: SqlClient)(implicit ec: Execu
} yield ()
}
}

class DatasetCoordinateTransformationsDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
extends SimpleSQLDAO(sqlClient) {
private def parseRow(row: DatasetLayerCoordinatetransformationsRow): Fox[CoordinateTransformation] =
for {
typeParsed <- CoordinateTransformationType.fromString(row.`type`).toFox
result <- typeParsed match {
case CoordinateTransformationType.affine => parseAffine(row.matrix)
case _ => Fox.failure(s"Unknown coordinate transformation type: ${row.`type`}")
}
} yield result

private def parseAffine(matrixRawOpt: Option[String]): Fox[CoordinateTransformation] =
for {
matrixString <- matrixRawOpt.toFox
matrix <- JsonHelper.parseAndValidateJson[List[List[Double]]](matrixString)
} yield CoordinateTransformation(CoordinateTransformationType.affine, Some(matrix))

def findCoordinateTransformationsForLayer(dataSetId: ObjectId,
layerName: String): Fox[List[CoordinateTransformation]] =
for {
rows <- run(
DatasetLayerCoordinatetransformations
.filter(r => r._Dataset === dataSetId.id && r.layername === layerName)
.result).map(_.toList)
rowsParsed <- Fox.combined(rows.map(parseRow)) ?~> "could not parse transformations row"
} yield rowsParsed

def updateCoordinateTransformations(dataSetId: ObjectId, dataLayersOpt: Option[List[DataLayer]]): Fox[Unit] = {
val clearQuery =
q"DELETE FROM webknossos.dataSet_layer_coordinateTransformations WHERE _dataSet = $dataSetId".asUpdate
val insertQueries = dataLayersOpt.getOrElse(List.empty).flatMap { layer: DataLayer =>
layer.coordinateTransformations.getOrElse(List.empty).map { coordinateTransformation: CoordinateTransformation =>
{
q"""INSERT INTO webknossos.dataSet_layer_coordinateTransformations(_dataSet, layerName, type, matrix)
values($dataSetId, ${layer.name}, ${coordinateTransformation.`type`}, ${Json.toJson(
coordinateTransformation.matrix)})""".asUpdate
}
}
}
for {
_ <- run(
DBIO.sequence(List(clearQuery) ++ insertQueries).transactionally.withTransactionIsolation(Serializable),
retryCount = 50,
retryIfErrorContains = List(transactionSerializationError)
)
} yield ()
}

}
3 changes: 2 additions & 1 deletion app/models/task/TaskType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class TaskTypeDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
settingsAllowedModes <- Fox.combined(
parseArrayLiteral(r.settingsAllowedmodes)
.map(TracingMode.fromString(_).toFox)) ?~> "failed to parse tracing mode"
settingsPreferredMode = r.settingsPreferredmode.flatMap(TracingMode.fromString)
} yield
TaskType(
ObjectId(r._Id),
Expand All @@ -89,7 +90,7 @@ class TaskTypeDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
r.description,
AnnotationSettings(
settingsAllowedModes,
r.settingsPreferredmode,
settingsPreferredMode,
r.settingsBranchpointsallowed,
r.settingsSomaclickingallowed,
r.settingsVolumeinterpolationallowed,
Expand Down
51 changes: 51 additions & 0 deletions conf/evolutions/101-coordinate-transformations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
START TRANSACTION;

CREATE TABLE webknossos.dataSet_layer_coordinateTransformations(
_dataSet CHAR(24) NOT NULL,
layerName VARCHAR(256) NOT NULL,
type VARCHAR(256) NOT NULL,
matrix JSONB
);

ALTER TABLE webknossos.dataSet_layer_coordinateTransformations
ADD CONSTRAINT dataSet_ref FOREIGN KEY(_dataSet) REFERENCES webknossos.dataSets(_id) DEFERRABLE;

-- Update default gpuMemoryFactor from 3 to 4 in user configuration
UPDATE webknossos.users
SET userconfiguration = CASE
WHEN (userconfiguration->>'gpuMemoryFactor')::NUMERIC = 3 THEN jsonb_set(
userconfiguration,
array['gpuMemoryFactor'],
to_jsonb(4::NUMERIC))
else
userconfiguration
END
WHERE userconfiguration ? 'gpuMemoryFactor';

-- Do the same for recommended configurations of task types
UPDATE webknossos.tasktypes
SET recommendedconfiguration = CASE
WHEN (recommendedconfiguration->>'gpuMemoryFactor')::NUMERIC = 3 THEN jsonb_set(
recommendedconfiguration,
array['gpuMemoryFactor'],
to_jsonb(4::NUMERIC))
else
recommendedconfiguration
END
WHERE recommendedconfiguration ? 'gpuMemoryFactor';

-- Disable interpolation for all users for performance reasons.
UPDATE webknossos.user_dataSetConfigurations
SET viewconfiguration = CASE
WHEN jsonb_typeof(viewconfiguration->'interpolation') = 'boolean' AND (viewconfiguration->>'interpolation')::boolean IS TRUE THEN jsonb_set(
viewconfiguration,
array['interpolation'],
to_jsonb(FALSE))
else
viewconfiguration
END
WHERE viewconfiguration ? 'interpolation';

UPDATE webknossos.releaseInformation SET schemaVersion = 101;

COMMIT TRANSACTION;
31 changes: 31 additions & 0 deletions conf/evolutions/reversions/101-coordinate-transformations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
START TRANSACTION;

DROP TABLE webknossos.dataSet_layer_coordinateTransformations;

-- Restore default gpuMemoryFactor from 4 to 3 in user configuration
UPDATE webknossos.users
SET userconfiguration = CASE
WHEN (userconfiguration->>'gpuMemoryFactor')::NUMERIC = 4 THEN jsonb_set(
userconfiguration,
array['gpuMemoryFactor'],
to_jsonb(3::NUMERIC))
else
userconfiguration
END
WHERE userconfiguration ? 'gpuMemoryFactor';

-- Do the same for recommended configurations of task types
UPDATE webknossos.tasktypes
SET recommendedconfiguration = CASE
WHEN (recommendedconfiguration->>'gpuMemoryFactor')::NUMERIC = 4 THEN jsonb_set(
recommendedconfiguration,
array['gpuMemoryFactor'],
to_jsonb(3::NUMERIC))
else
recommendedconfiguration
END
WHERE recommendedconfiguration ? 'gpuMemoryFactor';

UPDATE webknossos.releaseInformation SET schemaVersion = 100;

COMMIT TRANSACTION;
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function getRecommendedConfigByCategory() {
centerNewNode: true,
tdViewDisplayPlanes: TDViewDisplayModeEnum.WIREFRAME,
tdViewDisplayDatasetBorders: true,
tdViewDisplayLayerBorders: false,
},
all: {
dynamicSpaceDirection: true,
Expand Down
Loading

0 comments on commit 0879f2e

Please sign in to comment.