Skip to main content

Overview

The digipathai command accepts various command-line options to customize the web server behavior, tile rendering settings, and application features.

General Options

Slide Directory

-s, --slide_dir
string
default:"."
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.
Example:
digipathai -s /data/pathology/slides

Host Address

-l, --listen
string
default:"127.0.0.1"
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.
Example:
# Allow network access
digipathai -l 0.0.0.0

Port

-p, --port
integer
default:"8080"
Port number for the web server to listen on.
Example:
digipathai -p 5000

Debug Mode

-d, --debug
flag
default:"false"
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.
Example:
digipathai -d

Configuration File

-c, --config
string
Path to a Python configuration file to load additional settings. This file can override default Flask configuration values.
Example:
digipathai -c config.py

DeepZoom Tile Options

These options control how whole slide images are tiled and rendered using the DeepZoom format.

Tile Size

-S, --size
integer
default:"254"
Size of each tile in pixels. DeepZoom generates square tiles of this dimension.Larger tile sizes may improve performance but increase memory usage.
Example:
digipathai -S 512

Tile Overlap

-e, --overlap
integer
default:"1"
Number of pixels of overlap between adjacent tiles. Helps ensure seamless rendering when zooming.Typical values range from 0-2 pixels.
Example:
digipathai -e 2

Image Format

-f, --format
string
default:"jpeg"
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
Example:
digipathai -f png

JPEG Quality

-Q, --quality
integer
default:"75"
JPEG compression quality for tile images (1-100). Higher values produce better quality but larger files.Only applies when using JPEG format (-f jpeg).
Example:
digipathai -Q 90

Ignore Bounds

-B, --ignore-bounds
flag
default:"false"
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.
Example:
digipathai -B

Application Features

Viewer-Only Mode

--viewer-only
flag
default:"false"
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
Example:
digipathai --viewer-only
If the AI dependencies (PyTorch, TensorFlow, etc.) are not installed, the application will automatically behave as if --viewer-only is enabled.

Combined Usage Examples

Example 1: Production Server Setup

digipathai \
  -s /data/slides \
  -l 0.0.0.0 \
  -p 8080 \
  -Q 85 \
  -f jpeg
Starts a production server serving slides from /data/slides on all network interfaces, port 8080, with JPEG quality 85.

Example 2: High-Quality Local Viewing

digipathai \
  -s ./pathology_samples \
  -f png \
  -S 512 \
  -e 2
Local server with PNG tiles, larger tile size (512px), and 2-pixel overlap for highest quality.

Example 3: Development Configuration

digipathai \
  -d \
  -l 127.0.0.1 \
  -p 5000 \
  --viewer-only
Debug mode for development, local access only, custom port, viewer-only (no segmentation).

Example 4: Network Server with Full Scan Area

digipathai \
  -s /mnt/slides \
  -l 0.0.0.0 \
  -p 80 \
  -B \
  -Q 90
Network-accessible server on port 80, showing full scan area (ignoring bounds), high JPEG quality.

Option Summary Table

OptionShortTypeDefaultDescription
--slide_dir-sstring.Directory containing slide images
--listen-lstring127.0.0.1Network address to bind to
--port-pinteger8080Port number
--debug-dflagfalseEnable debug mode
--config-cstring-Configuration file path
--size-Sinteger254Tile size in pixels
--overlap-einteger1Tile overlap in pixels
--format-fstringjpegTile image format
--quality-Qinteger75JPEG compression quality
--ignore-bounds-BflagfalseDisplay entire scan area
--viewer-only-flagfalseDisable segmentation

Source Code Reference

All command-line options are defined in DigiPathAI/main_server.py lines 246-275 using Python’s optparse module.

Build docs developers (and LLMs) love