Skip to content

Commit

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

* 'master' of github.com:scalableminds/webknossos:
  Fix proofreading when mag 1 doesn't exist for segmentation layer (#6795)
  • Loading branch information
hotzenklotz committed Feb 1, 2023
2 parents 3802f86 + e90eaf2 commit 1fe3d63
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a bug where the dataset folders view would not list public datasets if the requesting user could not also access the dataset for other reasons, like being admin. [#6759](https://github.com/scalableminds/webknossos/pull/6759)
- Fixed a bug where zarr-streamed datasets would produce (very rare) rendering errors. [#6782](https://github.com/scalableminds/webknossos/pull/6782)
- Fixed a bug where publicly shared annotations were not viewable by users without an account. [#6784](https://github.com/scalableminds/webknossos/pull/6784)
- Fixed proofreading when mag 1 doesn't exist for segmentation layer [#6795](https://github.com/scalableminds/webknossos/pull/6795)
- Fixed that the proofreading tool allowed to split/merge with segment 0 which led to an inconsistent state. [#6793](https://github.com/scalableminds/webknossos/pull/6793)
- Fixed some layouting issues with line breaks in segment list/dataset info tab [#6799](https://github.com/scalableminds/webknossos/pull/6799)

Expand Down
9 changes: 6 additions & 3 deletions frontend/javascripts/oxalis/api/api_latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import {
} from "oxalis/model/accessors/volumetracing_accessor";
import { getHalfViewportExtentsFromState } from "oxalis/model/sagas/saga_selectors";
import {
getDatasetResolutionInfo,
getLayerBoundaries,
getLayerByName,
getResolutionInfo,
Expand Down Expand Up @@ -1549,10 +1548,12 @@ class DataApi {
topLeft: Vector3,
bottomRight: Vector3,
token: string,
resolution?: Vector3,
): string {
const { dataset } = Store.getState();
const resolutionInfo = getDatasetResolutionInfo(dataset);
const resolution = resolutionInfo.getLowestResolution();
const resolutionInfo = getResolutionInfo(getLayerByName(dataset, layerName, true).resolutions);
resolution = resolution || resolutionInfo.getLowestResolution();

const magString = resolution.join("-");
return (
`${dataset.dataStore.url}/data/datasets/${dataset.owningOrganization}/${dataset.name}/layers/${layerName}/data?mag=${magString}&` +
Expand Down Expand Up @@ -1591,13 +1592,15 @@ class DataApi {
layerName: string,
topLeft: Vector3,
bottomRight: Vector3,
resolution?: Vector3,
): Promise<ArrayBuffer> {
return doWithToken((token) => {
const downloadUrl = this._getDownloadUrlForRawDataCuboid(
layerName,
topLeft,
bottomRight,
token,
resolution,
);
return Request.receiveArraybuffer(downloadUrl);
});
Expand Down
12 changes: 10 additions & 2 deletions frontend/javascripts/oxalis/model/accessors/dataset_accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,19 @@ function _getResolutionInfoOfVisibleSegmentationLayer(state: OxalisState): Resol
export const getResolutionInfoOfVisibleSegmentationLayer = memoizeOne(
_getResolutionInfoOfVisibleSegmentationLayer,
);
export function getLayerByName(dataset: APIDataset, layerName: string): DataLayerType {
export function getLayerByName(
dataset: APIDataset,
layerName: string,
alsoMatchFallbackLayer: boolean = false,
): DataLayerType {
const dataLayers = getDataLayers(dataset);
const hasUniqueNames = _.uniqBy(dataLayers, "name").length === dataLayers.length;
ErrorHandling.assert(hasUniqueNames, messages["dataset.unique_layer_names"]);
const layer = dataLayers.find((l) => l.name === layerName);
const layer = dataLayers.find(
(l) =>
l.name === layerName ||
(alsoMatchFallbackLayer && "fallbackLayer" in l && l.fallbackLayer === layerName),
);

if (!layer) {
throw new Error(`Layer "${layerName}" not found`);
Expand Down
1 change: 1 addition & 0 deletions frontend/javascripts/oxalis/model/sagas/proofread_saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ function* createGetUnmappedDataValueFn(
fallbackLayerName,
nodePosition,
V3.add(nodePosition, mag),
mag,
);

return Number(new TypedArrayClass(buffer)[0]);
Expand Down

0 comments on commit 1fe3d63

Please sign in to comment.