Overview
Thedigipathai command accepts various command-line options to customize the web server behavior, tile rendering settings, and application features.
General Options
Slide Directory
Directory containing the whole slide images to serve. Defaults to the current directory.The application will recursively scan this directory for supported slide formats and display them in the file browser interface.
Host Address
Network address to listen on. Use
127.0.0.1 for local-only access, or 0.0.0.0 to allow connections from other machines.Port
Port number for the web server to listen on.
Debug Mode
Enable Flask debug mode for development. Provides detailed error messages and automatic code reloading.
Do not use debug mode in production environments as it can expose sensitive information and is insecure.
Configuration File
Path to a Python configuration file to load additional settings. This file can override default Flask configuration values.
DeepZoom Tile Options
These options control how whole slide images are tiled and rendered using the DeepZoom format.Tile Size
Size of each tile in pixels. DeepZoom generates square tiles of this dimension.Larger tile sizes may improve performance but increase memory usage.
Tile Overlap
Number of pixels of overlap between adjacent tiles. Helps ensure seamless rendering when zooming.Typical values range from 0-2 pixels.
Image Format
Image format for generated tiles. Supported values:
jpeg or png.- jpeg: Smaller file size, faster transfer, lossy compression
- png: Larger file size, lossless compression, slower transfer
JPEG Quality
JPEG compression quality for tile images (1-100). Higher values produce better quality but larger files.Only applies when using JPEG format (
-f jpeg).Ignore Bounds
Display the entire scan area instead of limiting to the slide bounds.By default, DigiPathAI limits the displayed area to the slide’s defined bounds. This flag disables that limitation and shows the full scanned area.
Application Features
Viewer-Only Mode
Disable AI segmentation functionality and run only the slide viewer.Use this mode when:
- GPU resources are not available
- AI dependencies are not installed
- You only need to view slides without performing analysis
Combined Usage Examples
Example 1: Production Server Setup
/data/slides on all network interfaces, port 8080, with JPEG quality 85.
Example 2: High-Quality Local Viewing
Example 3: Development Configuration
Example 4: Network Server with Full Scan Area
Option Summary Table
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--slide_dir | -s | string | . | Directory containing slide images |
--listen | -l | string | 127.0.0.1 | Network address to bind to |
--port | -p | integer | 8080 | Port number |
--debug | -d | flag | false | Enable debug mode |
--config | -c | string | - | Configuration file path |
--size | -S | integer | 254 | Tile size in pixels |
--overlap | -e | integer | 1 | Tile overlap in pixels |
--format | -f | string | jpeg | Tile image format |
--quality | -Q | integer | 75 | JPEG compression quality |
--ignore-bounds | -B | flag | false | Display entire scan area |
--viewer-only | - | flag | false | Disable segmentation |
Source Code Reference
All command-line options are defined inDigiPathAI/main_server.py lines 246-275 using Python’s optparse module.