ibl_alignment_gui.plugins.channel_prediction
Functions
|
Return the shanks a prediction is shown on: the aligned ones, in shank_loop's order. |
|
Keep and draw what each model computed, and report all problems once (main thread). |
|
Run each loaded model on its shanks, one after the other (background thread, no Qt). |
|
Tell the user another background task is still running. |
|
Return the shank's cached prediction views, by option. |
|
Draw the shank's cached view of |
|
Draw |
|
Draw every option on its own figure of each shank, saying which models are not loaded. |
|
Enable the plugin's menu, or grey it out with a hint saying a features file is needed. |
|
Adapt the worker's |
|
Keep the model a task loaded and the views it computed (main thread). |
|
Keep the loaded model and show its first option, or report the failure (main thread). |
|
Load a release of |
|
Load |
|
Data-load hook: reset per-session plugin state. |
|
Show |
|
Show every option of the loaded models on every aligned shank, side by side. |
|
Keep and draw what the task computed, and report its warnings and errors once (main thread). |
|
Load |
|
Show the warnings queued by the task and its errors in one dialog, if there are any. |
|
Select the model's first prediction option, which shows its predictions. |
|
Report a task that failed outside its own error handling (the worker logged it). |
|
Return the message for an unexpected error, whose traceback is logged. |
Return the models offered: those needing torch only when it is installed. |
|
Return whether torch is installed, without importing it. |
|
Return the title shown above a prediction panel, e.g. 'XGBoost prediction'. |
|
Register the Channel Prediction plugin and (when available) its menu. |
Classes
Plugin loader that computes and plots per-channel region predictions. |
|
|
What a background task did, handed back to the main thread when it ends. |
- class ibl_alignment_gui.plugins.channel_prediction.ChannelPrediction(controller)[source]
Bases:
objectPlugin loader that computes and plots per-channel region predictions.
Registered as the Channel Prediction plugin’s
loader;plot_predictions()shows the selected model option (MODEL_FOR_OPTION) on each shank’s prediction panel, computed in the background.- __init__(controller)[source]
Store the controller.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
- plot_all_predictions()[source]
Show every option of the loaded models side by side on every aligned shank.
The options of models that are not loaded say so; their models are not loaded here. The missing views are computed first, for all models in one background task (
_predict_all()).- Return type:
None
- plot_predictions(option)[source]
Show the selected model option on every aligned shank.
A model’s predictions are drawn from the cache, or computed first in the background (
_predict()). Problems are reported in one warning for all shanks.- Parameters:
option (str) – Prediction option (e.g. ‘Auto-alignment’, ‘XGBoost region prediction’, ‘XGBoost region prediction (cumulative)’). Unknown options are ignored.
- Return type:
None
- ibl_alignment_gui.plugins.channel_prediction.available_models()[source]
Return the models offered: those needing torch only when it is installed.
- Return type:
list[ModelSpec]
- ibl_alignment_gui.plugins.channel_prediction.has_torch()[source]
Return whether torch is installed, without importing it.
- Return type:
bool
- ibl_alignment_gui.plugins.channel_prediction.panel_title(option)[source]
Return the title shown above a prediction panel, e.g. ‘XGBoost prediction’.
- Return type:
str
- ibl_alignment_gui.plugins.channel_prediction.setup(controller)[source]
Register the Channel Prediction plugin and (when available) its menu.
Always installs the plugin state and its
ChannelPredictionloader. Whenephysatlasis importable, also adds the “Channel Prediction” menu (load inference/spatial models, load a features file), offers the models’ options in Prediction Plots and registers a data-loaded callback that resets the per-session plugin state.- Parameters:
controller (AlignmentGUIController) – The main application controller.
- Return type:
None