carousel
plantimager.webui.carousel Link
images_carousel Link
images_carousel(open_modal, image_task, dataset_id, host, port, prefix)
Create a Dash carousel component displaying images from a specified dataset task.
This callback function generates a Bootstrap-styled carousel component for displaying images associated with a specific task in a dataset. The carousel is only generated when the modal is open and a valid dataset ID is provided.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
open_modal
|
bool
|
Flag indicating whether the carousel modal is open |
required |
image_task
|
str
|
Name of the image processing task to display images from |
required |
dataset_id
|
str
|
Identifier of the dataset to retrieve images from |
required |
host
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
port
|
int
|
The port number of the PlantDB REST API server. |
required |
prefix
|
str
|
The prefix of the PlantDB REST API server. |
required |
Returns:
Type | Description |
---|---|
Carousel or None
|
A Bootstrap carousel component containing the task images if conditions are met, None if the modal is closed or dataset_id is invalid |
Source code in plantimager/webui/carousel.py
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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
update_image_task_dropdown Link
update_image_task_dropdown(open_modal, dataset_id, host, port, prefix)
Updates the dropdown options for image tasks based on the dataset and API configuration.
This callback function is triggered when the carousel modal is opened or closed. It fetches the available tasks for a given dataset from the API and filters them against predefined IMAGE_TASKS to provide relevant options for the dropdown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
open_modal
|
bool
|
State of the carousel modal (True if open, False if closed). |
required |
dataset_id
|
str or None
|
Identifier of the selected dataset. Can be None or empty string if no dataset is selected. |
required |
host
|
str
|
The hostname or IP address of the PlantDB REST API server. |
required |
port
|
int
|
The port number of the PlantDB REST API server. |
required |
prefix
|
str
|
The prefix of the PlantDB REST API server. |
required |
Returns:
Type | Description |
---|---|
list of str
|
List of available image task options. Returns ['images'] if the modal is closed or no dataset is selected. Otherwise returns the intersection of IMAGE_TASKS and the tasks available for the selected dataset. |
Source code in plantimager/webui/carousel.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|