Skip to content

Refactor Prediction App to include extended annotation workflow#14

Open
maartenpaul wants to merge 8 commits into
NL-BioImaging:trainingfrom
maartenpaul:feature/annotate-app
Open

Refactor Prediction App to include extended annotation workflow#14
maartenpaul wants to merge 8 commits into
NL-BioImaging:trainingfrom
maartenpaul:feature/annotate-app

Conversation

@maartenpaul
Copy link
Copy Markdown
Member

This pull request introduces several significant improvements and new features to the OMERO.biomero project for support for advanced annotation and training workflows. The main changes are summarized below.

Backend and Integration Enhancements:

  • Updated omero-init.sh to improve container initialization:
    • Ensures correct permissions on configuration files.
    • Installs both omero_annotate_ai and OMERO.biomero in editable mode for faster development.
    • Marks volume-mounted repositories as safe for Git, preventing setuptools_scm errors.
  • Added a new OMERO script, stardist_train.py, which submits a SLURM job to train a Stardist model. This script handles parameter validation, SLURM batch script creation, and job submission, enabling scalable model training from within OMERO.

Annotation and Prediction Features:

  • Introduced sam_views.py, providing backend endpoints for MobileSAM-based interactive segmentation:
    • Implements a thread-safe, lazy-loaded singleton for the SAM model.
    • Caches OMERO image planes for efficient repeated predictions.
    • Exposes /set_image and /predict endpoints for frontend integration, supporting point and box prompts and returning polygon results.
  • Enhanced the get_image_channels endpoint in prediction_views.py to include detailed channel windowing information (start, end, min, max), supporting more precise image rendering and normalization on the frontend.

These changes collectively improve the developer experience, enable advanced annotation workflows, and streamline training and prediction pipelines within the OMERO.biomero ecosystem.

@pmkrawczyk @RAHoebe Can you have a look at this. I tried to implement my annotation app on top of training branch. Please check if you can deploy it and let's discuss possible issues and improvements. Then we could merge this into the train branch to subsequently merge into main.

maartenpaul and others added 8 commits April 2, 2026 08:40
Replace PredictionApp with AnnotateApp featuring manifest-based
annotation set management, GeoJSON persistence, configurable
annotation workflow, and training integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add annotate_ai_views (manifest CRUD, GeoJSON persistence),
training_views (SLURM training integration), and sam_views.
Update urls.py, apiService.js, and index.js routing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tches is true

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Convert annotation overlay from Canvas to SVG for vector-quality
  rendering at any zoom level (non-scaling-stroke)
- Fix random Z-slice and timepoint selection (was always z=0)
- Add n_slices/n_timepoints UI inputs for random mode
- Distribute patches round-robin across z/t combinations
- Make patches enabled by default with helper text and tooltips
- Add percentile-based image normalization (compute_normalization endpoint)
- Add normalization config to ConfigureTab (percentile low/high)
- Auto-apply normalization in AnnotateViewer when loading images
- Fix validate button to not create annotation sets
- Lock Annotate tab navigation with warning when set is active
- Make unit list scrollable, thinner SVG strokes, smaller SAM points

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maartenpaul maartenpaul requested review from Copilot and pmkrawczyk and removed request for Copilot April 2, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant