ibl_alignment_gui.plugins.channel_prediction
Functions
|
Run a region-id |
|
Load inference model via GUI dialog; reveal its region options and refresh on success. |
|
Load the spatial model via dialog; reveal its region option and refresh on success. |
|
Data-load hook: reset per-session plugin state and expose available model region options. |
|
Compute (and cache) a shank's prediction for |
|
Add the region-plot options for models that should currently be available. |
|
Prompt for a per-channel features parquet and use it for inference. |
Cumulative prediction model using the inference model. |
|
Prediction model using the inference model. |
|
Return brain regions based on a specified atlas mapping, as an example prediction model. |
|
Prediction model using the spatial encoder. |
|
Get the boundaries of brain regions along the histology track. |
|
Register the Channel Prediction plugin and (when available) its menu. |
Classes
Plugin loader that computes and plots per-channel region predictions. |
- 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_regions()dispatches the selected region model to the matchingcompute_*function and draws it on each shank.- __init__(controller)[source]
Store the controller and cache its brain atlas.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
- plot_regions(model, data_only=True)[source]
Compute and plot the selected region model across all shanks.
Looks up
modelin the dispatch map and runs the matchingcompute_*function on each shank.- Parameters:
model (str) – Region-model key (e.g. ‘Beryl’, ‘Cosmos’, ‘Spatial Encoder’, ‘Inference Model’, ‘Inference Cumulative’). Unknown keys are ignored.
data_only (bool) – Reserved for signature compatibility with the region-plot callback; not used here.
- Return type:
None
- ibl_alignment_gui.plugins.channel_prediction.compute_cumulative_predictions(controller, items)[source]
Cumulative prediction model using the inference model.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
items (ShankController) – The shank controller containing the model and view for the current shank.
- Returns:
A bunch containing the probability of predicted brain regions along the probe, or None if no prediction is available.
- Return type:
Bunch or None
- ibl_alignment_gui.plugins.channel_prediction.compute_inference_predictions(controller, items)[source]
Prediction model using the inference model.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
items (ShankController) – The shank controller containing the model and view for the current shank.
- Returns:
The predicted brain regions along the probe, or None if no prediction is available.
- Return type:
Bunch or None
- ibl_alignment_gui.plugins.channel_prediction.compute_mapping_predictions(controller, items, mapping='Beryl')[source]
Return brain regions based on a specified atlas mapping, as an example prediction model.
- Parameters:
controller ('AlignmentGUIController') – The main application controller.
items ('ShankController') – The shank controller containing the model and view for the current shank.
mapping (str) – The atlas mapping to use for predictions (e.g., ‘Beryl’ or ‘Cosmos’).
- Returns:
A bunch containing the predicted brain regions.
- Return type:
Bunch
- ibl_alignment_gui.plugins.channel_prediction.compute_spatial_encoder_predictions(controller, items)[source]
Prediction model using the spatial encoder.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
items (ShankController) – The shank controller containing the model and view for the current shank.
- Returns:
The predicted brain regions along the probe, or None if no prediction is available.
- Return type:
Bunch or None
- ibl_alignment_gui.plugins.channel_prediction.get_region_boundaries(regions, depths)[source]
Get the boundaries of brain regions along the histology track.
- Parameters:
regions (dict) – The brain regions along the histology track.
depths (np.ndarray) – The depths along the histology track, in meters.
- Returns:
A bunch containing the region boundaries, labels, and colours.
- Return type:
Bunch
- 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) and registers a data-loaded callback that exposes the model region options.- Parameters:
controller (AlignmentGUIController) – The main application controller.
- Return type:
None