Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ This is a computational pathology SDK working with:

**WSI Processing:**

* OpenSlide for standard formats (.svs, .tiff, .ndpi)
* OpenSlide for standard formats (.svs, .tiff, .bif, .ndpi)
* PyDICOM for DICOM files
* Support for multi-resolution pyramidal images
* Tile-based processing for memory efficiency
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Aignostics Platform offers key features designed to maximize value for its users
2. **Multiple Access Points:** Interact with the platform via various pathways, from **Aignostics Launchpad** (desktop application for MacOS, Windows and Linux), **Aignostics CLI** (command-line interface for your terminal or shell scripts), **Example Notebooks** (we support Jupyter and Marimo), **Aignostics Client Library** (for integration with your Python codebase), or directly through the **API of the Aignostics Platform** (for integration with any programming language). Contact your business partner at Aignostics if you are interested to discuss a direct integration with your Imaging Management Systems (IMS) and Laboratory Information Management Systems (LIMS).
3. **Secure Data Handling:** Maintain control of your slide data through secure self-signed URLs. Results are automatically deleted after 30 days, and can be deleted earlier by the user.
4. **High-throughput processing with incremental results delivery:** Submit up to 500 whole slide images (WSI) in one batch request. Access results for individual slides as they completed processing, without having to wait for the entire batch to finish.
5. **Standard formats:** Support for commonly used image formats in digital pathology such as pyramidal DICOM, TIFF, and SVS. Results provided in standard formats like QuPath GeoJSON (polygons), TIFF (heatmaps) and CSV (measurements and statistics).
5. **Standard formats:** Support for commonly used image formats in digital pathology such as pyramidal DICOM, TIFF, SVS, NDPI, and BIF. Results provided in standard formats like QuPath GeoJSON (polygons), TIFF (heatmaps) and CSV (measurements and statistics).

### Registration and User Access

Expand Down
2 changes: 1 addition & 1 deletion docs/partials/README_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Aignostics Platform offers key features designed to maximize value for its users
2. **Multiple Access Points:** Interact with the platform via various pathways, from **Aignostics Launchpad** (desktop application for MacOS, Windows and Linux), **Aignostics CLI** (command-line interface for your terminal or shell scripts), **Example Notebooks** (we support Jupyter and Marimo), **Aignostics Client Library** (for integration with your Python codebase), or directly through the **API of the Aignostics Platform** (for integration with any programming language). Contact your business partner at Aignostics if you are interested to discuss a direct integration with your Imaging Management Systems (IMS) and Laboratory Information Management Systems (LIMS).
3. **Secure Data Handling:** Maintain control of your slide data through secure self-signed URLs. Results are automatically deleted after 30 days, and can be deleted earlier by the user.
4. **High-throughput processing with incremental results delivery:** Submit up to 500 whole slide images (WSI) in one batch request. Access results for individual slides as they completed processing, without having to wait for the entire batch to finish.
5. **Standard formats:** Support for commonly used image formats in digital pathology such as pyramidal DICOM, TIFF, and SVS. Results provided in standard formats like QuPath GeoJSON (polygons), TIFF (heatmaps) and CSV (measurements and statistics).
5. **Standard formats:** Support for commonly used image formats in digital pathology such as pyramidal DICOM, TIFF, SVS, NDPI, and BIF. Results provided in standard formats like QuPath GeoJSON (polygons), TIFF (heatmaps) and CSV (measurements and statistics).

### Registration and User Access

Expand Down
16 changes: 8 additions & 8 deletions specifications/SPEC-APPLICATION-SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Application Module shall:
### 1.4 Constraints and Limitations

- Platform API compatibility requirements with auto-generated client integration
- File format support limited to major medical imaging formats (DICOM, TIFF, SVS)
- File format support limited to major medical imaging formats (DICOM, TIFF, SVS, BIF, NDPI); HETA accepts BIF and NDPI only from version 2.2.0 on
- Memory management constraints for large file processing with configurable chunk sizes
- Optional QuPath integration requiring ijson dependency for full functionality

Expand Down Expand Up @@ -89,13 +89,13 @@ application/

### 3.1 Inputs

| Input Type | Source | Data Type/Format | Validation Rules | Business Rules |
| -------------------------- | ------------- | ---------------- | ------------------------------------------------------ | ----------------------------------------------- |
| **Supported WSI Files** | CLI/GUI | Path object | Must exist, extension in WSI_SUPPORTED_FILE_EXTENSIONS | File must be readable, format must be supported |
| **Application Version ID** | API | String | Must be valid UUID format | Must correspond to existing application version |
| **Input Items** | API | List[InputItem] | Each item must have valid metadata | Items must match application input schema |
| **Run ID** | API | String | Must be valid UUID format | Must correspond to existing application run |
| **Upload Chunks** | Configuration | Integer | Must be positive value | Configurable based on platform limits |
| Input Type | Source | Data Type/Format | Validation Rules | Business Rules |
| -------------------------- | ------------- | ---------------- | ------------------------------------------------------------------- | ----------------------------------------------- |
| **Supported WSI Files** | CLI/GUI | Path object | Must exist, extension supported by the resolved application version | File must be readable, format must be supported |
| **Application Version ID** | API | String | Must be valid UUID format | Must correspond to existing application version |
| **Input Items** | API | List[InputItem] | Each item must have valid metadata | Items must match application input schema |
| **Run ID** | API | String | Must be valid UUID format | Must correspond to existing application run |
| **Upload Chunks** | Configuration | Integer | Must be positive value | Configurable based on platform limits |

### 3.2 Outputs

Expand Down
20 changes: 10 additions & 10 deletions specifications/SPEC-QUPATH-SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The QuPath Module shall:

- **[FR-01]** Automatically download, verify, and install QuPath from GitHub releases with cross-platform support (Linux x64, macOS x64/ARM64, Windows x64)
- **[FR-02]** Maintain version-specific QuPath installations with health monitoring and compatibility validation
- **[FR-03]** Create QuPath projects automatically when adding images, with support for WSI files from various formats (DICOM, SVS, TIFF) and metadata synchronization
- **[FR-03]** Create QuPath projects automatically when adding images, with support for WSI files from various formats (DICOM, SVS, TIFF, BIF, NDPI) and metadata synchronization
- **[FR-04]** Import and process large-scale annotation datasets with batch processing, progress tracking, and error recovery
- **[FR-05]** Convert between Aignostics Platform annotation formats and QuPath-compatible GeoJSON with coordinate system validation
- **[FR-06]** Provide CLI, GUI, and notebook interfaces for scripted workflows, management service, and exploratory analysis
Expand Down Expand Up @@ -97,14 +97,14 @@ qupath/

### 3.1 Inputs

| Input Type | Source | Format/Type | Validation Rules |
| ----------------- | ----------- | --------------- | ----------------------------------------------------------------- |
| QuPath Version | CLI/GUI/API | String (semver) | Must match available GitHub releases, defaults to 0.6.0-rc5 |
| Installation Path | CLI/GUI | Path | Must be writable directory, defaults to user data directory |
| Platform Override | CLI | String | Must be valid platform identifier (Windows/Linux/Darwin) |
| WSI File Paths | CLI/API | List[Path] | Files must exist and be readable, supports DICOM/SVS/TIFF formats |
| Annotation Data | CLI/API | GeoJSON/JSON | Must contain valid coordinate data and classification schemas |
| Project Metadata | API | Dict | Key-value pairs for QuPath project properties |
| Input Type | Source | Format/Type | Validation Rules |
| ----------------- | ----------- | --------------- | -------------------------------------------------------------------------- |
| QuPath Version | CLI/GUI/API | String (semver) | Must match available GitHub releases, defaults to 0.6.0-rc5 |
| Installation Path | CLI/GUI | Path | Must be writable directory, defaults to user data directory |
| Platform Override | CLI | String | Must be valid platform identifier (Windows/Linux/Darwin) |
| WSI File Paths | CLI/API | List[Path] | Files must exist and be readable, supports DICOM/SVS/TIFF/BIF/NDPI formats |
| Annotation Data | CLI/API | GeoJSON/JSON | Must contain valid coordinate data and classification schemas |
| Project Metadata | API | Dict | Key-value pairs for QuPath project properties |

### 3.2 Outputs

Expand Down Expand Up @@ -362,7 +362,7 @@ uvx aignostics qupath terminate

- **QuPath Version**: Must match semver pattern and be available in GitHub releases
- **Installation Path**: Must be writable directory with sufficient disk space
- **WSI File Paths**: Files must exist, be readable, and match supported formats (DICOM, SVS, TIFF)
- **WSI File Paths**: Files must exist, be readable, and match supported formats (DICOM, SVS, TIFF, BIF, NDPI)
- **Annotation Data**: Must contain valid GeoJSON structure with coordinate data and classification schemas

### 7.3 Graceful Degradation
Expand Down
21 changes: 11 additions & 10 deletions specifications/SPEC_WSI_SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The WSI (Whole Slide Image) Module provides comprehensive support for digital pa

The WSI Module shall:

- **[FR-01]** Support multi-format WSI processing including DICOM (.dcm), TIFF/BigTIFF (.tiff, .tif), and Aperio SVS (.svs) formats
- **[FR-01]** Support multi-format WSI processing including DICOM (.dcm), TIFF/BigTIFF (.tiff, .tif), Aperio SVS (.svs), Ventana BIF (.bif), and Hamamatsu NDPI (.ndpi) formats
- **[FR-02]** Generate standardized PNG thumbnails (256x256 pixels) from any supported WSI format
- **[FR-03]** Extract comprehensive metadata from WSI files including resolution, dimensions, and format-specific properties
- **[FR-04]** Provide DICOM-specific hierarchical organization by study → container (slide) → series
Expand All @@ -38,10 +38,11 @@ The WSI Module shall:

### 1.4 Constraints and Limitations

- **File Format Support**: Limited to extensions defined in `WSI_SUPPORTED_FILE_EXTENSIONS = {".dcm", ".tiff", ".tif", ".svs"}` with format-specific capabilities:
- **File Format Support**: Limited to extensions defined in `WSI_SUPPORTED_FILE_EXTENSIONS = {".dcm", ".tiff", ".tif", ".svs", ".bif", ".ndpi"}` with format-specific capabilities:
- DICOM (.dcm): Complete metadata, pyramidal support, annotation support via PydicomHandler
- TIFF/BigTIFF (.tiff, .tif): Standard metadata, pyramidal support, limited annotations via OpenSlideHandler
- Aperio SVS (.svs): Vendor-specific metadata, pyramidal support, no annotation support via OpenSlideHandler
- Ventana BIF (.bif) and Hamamatsu NDPI (.ndpi): Vendor-specific metadata, pyramidal support, no annotation support via OpenSlideHandler
- **OpenSlide Dependency**: Non-DICOM formats require OpenSlide library installation for processing
- **Memory Constraints**: Large WSI files require careful memory management and streaming operations
- **Platform Dependencies**: Requires platform-specific compilation of OpenSlide and image processing libraries
Expand All @@ -60,7 +61,7 @@ wsi/
├── _service.py # Core business logic and WSI processing service
├── _cli.py # Command-line interface for WSI inspection
├── _gui.py # Web-based GUI components and HTTP endpoints
├── _openslide_handler.py # Handler for TIFF/SVS formats using OpenSlide
├── _openslide_handler.py # Handler for TIFF/SVS/BIF/NDPI formats using OpenSlide
├── _pydicom_handler.py # Handler for DICOM formats using PyDICOM/HighDICOM
├── _utils.py # Helper functions for output formatting
├── __init__.py # Module exports and public API
Expand All @@ -73,7 +74,7 @@ wsi/
| Component | Type | Purpose | Public Interface | Dependencies |
| ------------------ | ----- | ------------------------------------- | ------------------------------------------------------------ | -------------------------------- |
| `Service` | Class | Core WSI processing service | Thumbnail generation, metadata extraction, format conversion | OpenSlideHandler, PydicomHandler |
| `OpenSlideHandler` | Class | Handles TIFF/SVS formats | Format detection, thumbnail creation, metadata parsing | OpenSlide, PIL |
| `OpenSlideHandler` | Class | Handles TIFF/SVS/BIF/NDPI formats | Format detection, thumbnail creation, metadata parsing | OpenSlide, PIL |
| `PydicomHandler` | Class | Handles DICOM formats and annotations | DICOM parsing, hierarchy organization, annotation import | PyDICOM, HighDICOM |
| `PageBuilder` | Class | Web interface registration | HTTP endpoint registration | NiceGUI (optional) |
| `cli` | Typer | Command-line interface | WSI inspection, DICOM analysis | Typer, Rich |
Expand Down Expand Up @@ -389,7 +390,7 @@ uvx aignostics wsi [subcommand] [options]

| Dependency | Min Version | Purpose | Optional/Required | Fallback Behavior |
| ------------------ | ----------- | -------------------------------------- | ---------------------- | ----------------------------------- |
| `openslide-python` | Latest | Reading TIFF/SVS formats | Required for non-DICOM | Clear error with installation guide |
| `openslide-python` | Latest | Reading TIFF/SVS/BIF/NDPI formats | Required for non-DICOM | Clear error with installation guide |
| `pydicom` | Latest | DICOM file parsing | Required for DICOM | Error message for DICOM operations |
| `highdicom` | Latest | DICOM annotation handling | Required for DICOM | Annotation features unavailable |
| `Pillow (PIL)` | Latest | Image processing and format conversion | Required | Core functionality fails |
Expand All @@ -413,11 +414,11 @@ _Note: For exact version requirements, refer to `pyproject.toml` and dependency

### 6.1 Configuration Parameters

| Parameter | Type | Default | Description | Required |
| ------------------------------- | ----------------- | ----------------------------------- | ------------------------------- | -------- |
| `WSI_SUPPORTED_FILE_EXTENSIONS` | `set[str]` | `{".dcm", ".tiff", ".tif", ".svs"}` | Supported WSI file extensions | Yes |
| `TIMEOUT` | `int` | `60` | HTTP request timeout in seconds | No |
| Thumbnail size | `tuple[int, int]` | `(256, 256)` | Standard thumbnail dimensions | No |
| Parameter | Type | Default | Description | Required |
| ------------------------------- | ----------------- | ---------------------------------------------------- | ------------------------------- | -------- |
| `WSI_SUPPORTED_FILE_EXTENSIONS` | `set[str]` | `{".dcm", ".tiff", ".tif", ".svs", ".bif", ".ndpi"}` | Supported WSI file extensions | Yes |
| `TIMEOUT` | `int` | `60` | HTTP request timeout in seconds | No |
| Thumbnail size | `tuple[int, int]` | `(256, 256)` | Standard thumbnail dimensions | No |

### 6.2 Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ handling, IDC access, Marimo notebook assets, thumbnailing, TIFF I/O).
- **Core Features**: Format detection, thumbnail generation, metadata extraction
- **CLI**: `inspect`; `dicom inspect`, `dicom geojson_import` (see `wsi/_cli.py`)
- **GUI**: Image viewer and metadata display
- **Handlers**: OpenSlide (.svs, .tiff), PyDICOM (DICOM files)
- **Handlers**: OpenSlide (.svs, .tiff, .bif, .ndpi), PyDICOM (DICOM files)
- **Dependencies**: `utils` (logging)

### 📦 dataset
Expand Down
27 changes: 24 additions & 3 deletions src/aignostics/application/_gui/_page_application_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from nicegui import run as nicegui_run
from nicegui.events import ValueChangeEventArguments

from aignostics.constants import WSI_SUPPORTED_FILE_EXTENSIONS
from aignostics.constants import HETA_APPLICATION_ID, TEST_APP_APPLICATION_ID, WSI_SUPPORTED_FILE_EXTENSIONS
from aignostics.platform import (
DEFAULT_CPU_PROVISIONING_MODE,
DEFAULT_FLEX_START_MAX_RUN_DURATION_MINUTES,
Expand All @@ -28,7 +28,7 @@
from aignostics.platform import UserInfo

from .._service import Service # noqa: TID252
from .._utils import get_mime_type_for_artifact # noqa: TID252
from .._utils import get_mime_type_for_artifact, get_supported_extensions_for_application # noqa: TID252
from ._frame import _frame
from ._utils import (
application_id_to_icon,
Expand Down Expand Up @@ -175,6 +175,23 @@ class SubmitForm:

submit_form = SubmitForm()


def _supported_formats_text(application_id: str | None, application_version: str | None) -> str:
"""Label text listing the file formats the selected application version accepts.

Args:
application_id: The application ID.
application_version: The selected application version.

Returns:
str: The label text.
"""
extensions = WSI_SUPPORTED_FILE_EXTENSIONS
if application_version and application_id in {HETA_APPLICATION_ID, TEST_APP_APPLICATION_ID}:
extensions = get_supported_extensions_for_application(application_id, application_version)
Comment on lines +190 to +191
return f"Supported formats: {', '.join(sorted(extensions))}"


upload_message_queue = Manager().Queue()

service = Service()
Expand Down Expand Up @@ -487,7 +504,11 @@ def _info_dialog_content() -> None:
submit_form.wsi_step_label = ui.label(
"Select the folder with the whole slide images you want to analyze then click Next."
)
ui.label(f"Supported formats: {', '.join(sorted(WSI_SUPPORTED_FILE_EXTENSIONS))}").classes("text-caption")
ui.label().classes("text-caption").bind_text_from(
submit_form,
"application_version",
backward=lambda version: _supported_formats_text(submit_form.application_id, version),
)
with ui.stepper_navigation():
if "pytest" in sys.modules:
ui.button("Home", on_click=_pytest_home, icon="folder").mark("BUTTON_PYTEST_HOME")
Expand Down
Loading
Loading