utils
plantimager.webui.utils Link
Utility Functions for Plant Imager Web UI.
This module provides common utility functions used across the Plant Imager web interface, particularly for interacting with the PlantDB REST API and handling configuration files.
Key Features
- Dataset retrieval and management
- Pipeline configuration handling
- TOML configuration file upload component
- REST API interaction helpers
Usage Examples
>>> from plantimager.webui.utils import get_dataset_dict, has_pipeline_cfg
>>> # Get all datasets from the PlantDB server
>>> datasets = get_dataset_dict('localhost', '5000')
>>> # Check if a dataset has a pipeline configuration
>>> has_config = has_pipeline_cfg('localhost', '5000', 'my_plant_scan')
config_upload Link
config_upload()
The TOML configuration file upload component.
Returns:
Type | Description |
---|---|
Upload
|
A Dash Upload component configured for TOML files. |
Source code in plantimager/webui/utils.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
get_dataset_dict Link
get_dataset_dict(host, port, prefix)
Returns the dataset dictionary for the PlantDB REST API at given host url and port.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
port
|
str
|
The port number of the PlantDB REST API server. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any] | None
|
The dataset dictionary for the PlantDB REST API at given host url and port.
Returns |
See Also
plantdb.rest_api_client.list_scan_names plantdb.rest_api_client.parse_scans_info
Source code in plantimager/webui/utils.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|