Napari PySPIM Plugin API Reference¶
napari_pyspim
¶
diSPIM Processing Pipeline - A napari plugin for processing dual-view SPIM data.
Classes¶
DispimPipelineWidget(napari_viewer)
¶
Bases: QWidget
Main widget containing all diSPIM processing steps.
Source code in packages/napari-pyspim/src/napari_pyspim/_main_widget.py
Functions¶
setup_ui()
¶
Set up the user interface with tabs for each processing step.
Source code in packages/napari-pyspim/src/napari_pyspim/_main_widget.py
RemoteClient(parent=None)
¶
Bases: QObject
Manages SSH connection and communication with remote compute server.
Signals¶
connected Emitted when the remote server is ready. disconnected Emitted when the connection is closed. error : str Emitted when an error occurs. progress : str, int Emitted for progress updates from the server (message, percentage). command_response : dict Emitted when a command response arrives from the server. The dict contains keys: request_id, success, result, error.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
Attributes¶
is_connected: bool
property
¶
Return True if SSH connection is active.
server_capabilities: dict
property
¶
Return capabilities reported by the server on startup.
Functions¶
connect(host: str, port: int, username: str, auth_method: str, password: str | None = None, key_path: str | None = None, key_passphrase: str | None = None, remote_venv: str | None = None, jump_host: str | None = None) -> bool
¶
Establish SSH connection and start remote Python session.
Parameters¶
host : str
Remote server hostname or IP.
port : int
SSH port (default 22).
username : str
SSH username.
auth_method : str
"password" or "key".
password : str, optional
SSH password (required when auth_method="password").
key_path : str, optional
Path to local SSH private key (required when auth_method="key").
key_passphrase : str, optional
Passphrase for encrypted private key.
remote_venv : str, optional
Path to the pyspim virtualenv on the remote server.
jump_host : str, optional
Hostname of the jump (bastion) host to route through.
Returns¶
bool True if connection succeeded.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
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 171 172 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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
disconnect_session()
¶
Terminate remote session and close SSH connection.
Named disconnect_session to avoid conflict with QObject.disconnect().
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
send_command(command: str, params: dict, callback: Callable | None = None, progress_callback: Callable | None = None) -> int
¶
Send a command to the remote server.
Parameters¶
command : str
Command name (e.g. "ping", "load_deskew").
params : dict
Command-specific parameters.
callback : callable, optional
Called with the response dict when the command completes.
progress_callback : callable, optional
Called with (message, percentage) for progress updates.
Returns¶
int The request_id assigned to this command.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
send_command_blocking(command: str, params: dict, timeout: float = 300.0) -> dict
¶
Send a command and block until the response arrives.
Parameters¶
command : str Command name. params : dict Command-specific parameters. timeout : float Maximum seconds to wait for a response.
Returns¶
dict The response dict from the server.
Raises¶
RuntimeError If not connected or the command times out / fails.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
list_directory(remote_path: str) -> list[dict]
¶
List directory contents via SFTP.
Returns¶
list[dict]
Each dict has keys: name, is_dir, size.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_client.py
get_sftp_client() -> paramiko.SFTPClient
¶
Return the active SFTP client for file browser operations.
RemoteConnectionWidget(napari_viewer, remote_client: Optional[RemoteClient] = None)
¶
Bases: QWidget
Tab 0 widget for SSH connection management.
Parameters¶
napari_viewer
The napari viewer instance (passed by plugin infrastructure).
remote_client : RemoteClient, optional
Pre-existing client to reuse. If None a new one is created.
Source code in packages/napari-pyspim/src/napari_pyspim/_remote_connection.py
SftpBrowserDialog(sftp_client: paramiko.SFTPClient, parent=None, initial_path: str = '/', title: str = 'Browse Remote Directory', select_file: bool = False, file_filter: Optional[str] = None)
¶
Bases: QDialog
Dialog for browsing remote directories or files via SFTP.
Parameters¶
sftp_client : paramiko.SFTPClient Active SFTP client. parent : QWidget, optional Parent widget. initial_path : str Starting directory path. title : str Dialog title. select_file : bool If True, allow selecting individual files (double-click or Select). If False, only directories can be selected (default). file_filter : str, optional Glob-like filter pattern for file selection mode (e.g., "*.npy *.tif"). Only files matching the pattern are selectable.
Source code in packages/napari-pyspim/src/napari_pyspim/_sftp_browser.py
Modules¶
tests
¶
Modules¶
test_basic
¶
Basic tests that don't require CUDA compilation.
test_manifest()
¶Test that the manifest can be accessed without importing the full plugin.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_basic.py
test_utils()
¶Test utility functions.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_basic.py
test_plugin
¶
Basic tests for the napari-pyspim plugin.
test_plugin_import()
¶Test that the plugin can be imported.
test_widget_creation()
¶Test that the main widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_roi_detection_widget()
¶Test that the ROI detection widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_registration_widget()
¶Test that the registration widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_deconvolution_widget()
¶Test that the deconvolution widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_utils()
¶Test utility functions.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
napari_pyspim.tests.test_plugin
¶
Basic tests for the napari-pyspim plugin.
Classes¶
Functions¶
test_plugin_import()
¶
Test that the plugin can be imported.
test_widget_creation()
¶
Test that the main widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_roi_detection_widget()
¶
Test that the ROI detection widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_registration_widget()
¶
Test that the registration widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_deconvolution_widget()
¶
Test that the deconvolution widget can be created.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
test_utils()
¶
Test utility functions.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_plugin.py
napari_pyspim.tests.test_basic
¶
Basic tests that don't require CUDA compilation.
Functions¶
test_manifest()
¶
Test that the manifest can be accessed without importing the full plugin.
Source code in packages/napari-pyspim/src/napari_pyspim/tests/test_basic.py
test_utils()
¶
Test utility functions.