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

Web UI #7

Merged
merged 19 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion docs/data-providing-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def save_annotation(annotations_folder: str, image_name: str, features, image_sh
n_image_masks = len(
[f for f in os.listdir(annotations_folder) if f.startswith(image_name)]
)
mask_name = os.pth.join(
mask_name = os.path.join(
annotations_folder, f"{image_name}_mask_{n_image_masks + 1}.tif"
)
imwrite(mask_name, mask)
Expand Down
5 changes: 2 additions & 3 deletions plugins/bioimageio-colab-annotator.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
this.image = null; // Current image
this.mask = null; // Current mask
this.filename = null; // Filename of the current image
this.newname = null; // New name for the annotation file
this.imageLayer = null; // Layer displaying the image
this.annotationLayer = null; // Layer displaying the annotations
this.edgeColor = "magenta"; // Default edge color for annotations
Expand Down Expand Up @@ -89,7 +88,7 @@
}

// Fetch a random image from the service
[this.image, this.filename, this.newname] = await dataProvider.get_random_image();
[this.image, this.filename] = await dataProvider.get_random_image();
this.imageLayer = await viewer.view_image(this.image, {name: "image"});

// Reset the predictorId for the new image
Expand Down Expand Up @@ -158,7 +157,7 @@
if (!this.annotationLayer) return;
const annotation = await this.annotationLayer.get_features();
if (annotation.features.length > 0) {
await dataProvider.save_annotation(this.filename, this.newname, annotation, [this.image._rshape[0], this.image._rshape[1]]);
await dataProvider.save_annotation(this.filename, annotation, [this.image._rshape[0], this.image._rshape[1]]);
nilsmechtel marked this conversation as resolved.
Show resolved Hide resolved
await api.showMessage(`Annotation Saved to ${this.filename}`);
} else {
await api.showMessage("Skip saving annotation");
Expand Down
Loading