Skip to content

Commit

Permalink
Update microdraw.js
Browse files Browse the repository at this point in the history
the 'slice' parameter in fileID is currently the display name, it should be the slice index. The regex was appropriately made to handle only numbers, which works when the slice index is used to make a default display name (see line ~2050). I'm patching it to recover the complete string.
  • Loading branch information
r03ert0 authored Jan 4, 2025
1 parent 10ccb64 commit 42f4372
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/public/js/microdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,13 @@ const Microdraw = (function () {
const regions = me._convertDBAnnotationsToRegions(data);

if (data.length) {
const match = data[0].fileID.match(/slice=(\d+)/);
/** @todo: the 'slice' parameter in fileID is currently the display name,
it should be the slice index. The regex was appropriately made to handle
only numbers, which works when the slice index is used to make a default
display name (see line ~2050). I'm patching it to recover the complete
string.
*/
const match = data[0].fileID.match(/slice=(.+)/);

if (!match) {
throw new Error("Annotation fileID does not have a slice number indicated");
Expand Down

0 comments on commit 42f4372

Please sign in to comment.