app
plantimager.webui.app Link
Plant Imager Web Interface
A web-based user interface for the Plant Imager system, providing a graphical front-end to interact with the PlantDB REST API for plant imaging, analysis, and dataset management.
Key Features
- Bootstrap-styled Dash web application for plant imaging
- REST API connectivity for data operations
- User authentication and account management
- Dataset acquisition with metadata management
Usage Examples
Run the web interface with default REST API settingsLink
$ python app.py
Connect to a specific REST API serverLink
$ python app.py --api_host http://example-server --api_port 5000
main Link
main()
Run the Plant Imager Web Interface application.
This function serves as the entry point for the Plant Imager Web UI. It: 1. Parses command-line arguments for REST API connection settings 2. Establishes a ZeroMQ connection to the controller service 3. Initializes and runs the Dash web application
Notes
- The controller connection runs in a separate daemon thread
- The Dash application runs in debug mode on port 8000
Source code in plantimager/webui/app.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
parsing Link
parsing()
Create and configure the command-line argument parser for the Plant Imager WebUI.
Sets up command-line arguments for configuring the connection to the PlantDB REST API, including host address and port options.
Returns:
Type | Description |
---|---|
ArgumentParser
|
Configured argument parser with application options |
Examples:
>>> from plantimager.webui.app import parsing
>>> parser = parsing()
>>> args = parser.parse_args(['--api_host', '192.168.1.100', '--api_port', '5001', '--api_prefix', '/plantdb'])
>>> print(f"https://{args.api_host}:{args.api_port}{args.api_prefix}")
https://192.168.1.100:5001/plantdb
Source code in plantimager/webui/app.py
49 50 51 52 53 54 55 56 57 58 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 |
|
setup_web_app Link
setup_web_app(api_url, api_port, api_prefix, proxy=False, url_base_pathname='/webui/')
Initialize and configure the Plant Imager Dash web application.
Creates a Dash application instance with Bootstrap styling and sets up the main layout including navigation bar, modals, and content areas. The application is configured with global state storage for REST API connection details, user authentication, and dataset management.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_url
|
str
|
The base URL for the PlantDB REST API server (e.g., 'http://localhost') |
required |
api_port
|
int
|
The port number for the PlantDB REST API server connection |
required |
api_prefix
|
str
|
URL prefix of the PlantDB REST API server. |
required |
proxy
|
bool
|
Boolean flag indicating whether the application is behind a reverse proxy, by default |
False
|
url_base_pathname
|
str
|
The base URL path where the application is served (should match Nginx location) |
'/webui/'
|
Returns:
Type | Description |
---|---|
Dash
|
Configured Dash application instance with complete layout and callbacks |
Notes
The application layout includes several components: - Global state management using dcc.Store components - Navigation bar with ROMI branding - Configuration and authentication modals - Main content area for scan management
Source code in plantimager/webui/app.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|