Overview
The web interface is built with Flask and OpenSeadragon, offering:- Deep Zoom visualization for high-resolution WSI viewing
- File browser for navigating slide collections
- Interactive segmentation controls for tissue analysis
- Real-time progress monitoring during segmentation
- Overlay visualization for masks and uncertainty maps
Starting the Server
Launch the web server with the following command:Server Options
| Option | Description | Default |
|---|---|---|
-s, --slide_dir | Directory containing WSI images | Current directory |
-p, --port | Port to listen on | 8080 |
-l, --listen | Address to listen on | 127.0.0.1 |
--viewer-only | Disable segmentation (view-only mode) | False |
-Q, --quality | JPEG compression quality for tiles | 75 |
-S, --size | Tile size in pixels | 254 |
-e, --overlap | Overlap of adjacent tiles | 1 |
File Browser
The home page displays a hierarchical file browser showing all compatible WSI files in the slide directory.Navigate directories
The file browser recursively scans the slide directory and displays all subdirectories containing supported slide formats.
Identify processed slides
Slides with existing segmentation masks are marked in the file list. The system automatically detects masks with the
-dgai-mask suffix.Supported Formats
The interface supports any format compatible with OpenSlide, including:.svs(Aperio).tiff,.tif(Generic TIFF/BigTIFF).ndpi(Hamamatsu).vms,.vmu(Hamamatsu VMU).scn(Leica).mrxs(MIRAX).bif(Ventana)
Image Viewer Features
Deep Zoom Navigation
The viewer uses OpenSeadragon’s Deep Zoom technology for smooth navigation of high-resolution images. Navigation Controls:- Mouse wheel: Zoom in/out (2x per scroll)
- Click and drag: Pan across the image
- Double-click: Zoom in to that location
- Home button: Reset to initial view
The viewer automatically skips the lowest 8 resolution levels to improve load times. This is configurable in the viewer settings.
Scale Bar
A calibrated scale bar is displayed when MPP (microns per pixel) metadata is available in the slide:Slide Properties Panel
The properties panel displays slide metadata:- Dimensions: Width x Height in pixels
- Area: Total image area (in million/thousand pixels)
- MPP: Microns per pixel (if available)
Segmentation Controls
Tissue Type Selection
Before running segmentation, select the appropriate tissue type from the dropdown menu:Click the Tissue Type dropdown
Located in the left sidebar, this menu is marked with a red asterisk (*) indicating it’s required.
Select tissue type
Choose from:
- Colon - For colorectal tissue segmentation
- Liver - For liver tissue segmentation
- Breast - For breast tissue segmentation
Running Segmentation
When you click “Get segmentation”:- The system sends a POST request to
/segmentwith the selected tissue type - A background thread starts the segmentation process
- The button becomes disabled to prevent duplicate runs
- Progress updates are fetched every 2 seconds via
/check_segment_status
Progress Monitoring
During segmentation, you’ll see:- Status text: Current operation (e.g., “Downloading Trained Models”, “Running segmentation”)
- Progress bar: Percentage completion (0-100%)
Mask Overlay Toggle
Once segmentation completes, you can visualize results:Show Cancer Regions Toggle
Show Cancer Regions Toggle
- Location: Top of left sidebar
- Function: Overlays segmentation mask on the original WSI
- Opacity: 50% blend when enabled
- Shortcut: Click the switch to toggle on/off
The mask toggle is disabled until segmentation completes. After processing, the page automatically refreshes to enable the overlay controls.
Viewer-Only Mode
When the server runs with--viewer-only flag or when VIEWER_ONLY=True:
- Segmentation button shows “Segmentation Disabled”
- A message “GPU not available” is displayed
- You can still view pre-existing segmentation masks
- All navigation and visualization features remain available
Cache Management
The server implements an LRU cache for opened slides:Deep Zoom Tile Configuration
Tiles are generated with these settings:Troubleshooting
Slides not appearing in file browser
Slides not appearing in file browser
- Ensure slides are in supported formats (OpenSlide compatible)
- Check file permissions in the slide directory
- Verify the slide directory path is correct
- Files with
-dgai-maskor-dgai-uncertaintysuffixes are hidden from the main list
Segmentation button disabled
Segmentation button disabled
Slow tile loading
Slow tile loading
- Increase
DEEPZOOM_TILE_QUALITYfor better compression (lower quality) - Check network connection if accessing remotely
- Ensure sufficient server memory for the slide cache
Next Steps
Running Segmentation
Learn the detailed workflow for tissue segmentation
Understanding Results
Interpret segmentation masks and uncertainty maps