Overview
The DigiPathAI server provides a web-based interface for viewing whole slide images and running AI-powered segmentation. Server configuration is managed through command-line options when startingmain_server.py.
Command-Line Options
All server options can be specified when launching the server:Host and Port Configuration
IP address for the server to listen on. Use
0.0.0.0 to allow external connections.Port number for the server to listen on.
Slide Directory
Directory containing the whole slide images. Defaults to current directory.
The slide directory is recursively scanned for compatible whole slide image formats detected by OpenSlide (
.svs, .tiff, .ndpi, etc.).Deep Zoom Parameters
Deep Zoom configuration controls how whole slide images are tiled and served to the viewer.Tile size in pixels for Deep Zoom tiles. Standard value is 254 pixels.
Overlap of adjacent tiles in pixels. Helps ensure smooth viewing transitions.
JPEG compression quality for tiles (1-100). Higher values produce better quality but larger file sizes.
Image format for tiles. Allowed values:
jpeg or png.Display entire scan area instead of limiting to tissue bounds.
Operating Modes
Run in viewer-only mode, disabling AI segmentation functionality. Useful for systems without GPU or when only image viewing is needed.
Additional Options
Path to a Python configuration file. Settings in the config file can be overridden by command-line options.
Run server in debugging mode with auto-reload and detailed error messages.
Configuration File
Instead of using command-line options, you can create a Python configuration file:config.py
Complete Example
Launch server with custom settings:Default Configuration
The following defaults are defined inmain_server.py (lines 21-28):
Troubleshooting
Server won't start or connection refused
Server won't start or connection refused
- Check if the port is already in use:
lsof -i :<port> - Verify firewall settings allow the port
- Try changing the port with
--port
Slides not appearing in viewer
Slides not appearing in viewer
- Verify slide directory path is correct
- Check that slides are in OpenSlide-compatible format
- Review server console for error messages
- Ensure slides don’t contain ‘dgai-mask’ or ‘dgai-uncertainty’ in filename (these are filtered)
Poor image quality in viewer
Poor image quality in viewer
- Increase JPEG quality with
--quality 90or higher - Consider using PNG format with
--format png(slower but lossless) - Adjust tile size with
--sizefor different performance characteristics
Source Reference
Configuration options are defined inmain_server.py:245-297.