ibl_alignment_gui.app.shank_controller
Classes
Controller for handling data and plots on a shank of a probe for a given configuration. |
- class ibl_alignment_gui.app.shank_controller.ShankController(model, name, index, config)[source]
Bases:
objectController for handling data and plots on a shank of a probe for a given configuration.
- Parameters:
model (ShankHandler) – The model containing all the data for the shank and config combination
name (str) – The name of shank
index (int) – The index of the shank
config (
str) – The config of the shank
- name
The name of shank
- Type:
str
- index
The index of the shank
- Type:
int
- config
The config of the shank
- model
The model containing all the data for the shank and config combination
- Type:
- cluster
Whether the chosen scatter plot contains cluster data
- Type:
bool
- cluster_data
The cluster data for the chosen scatter plot if it exists
- Type:
np.ndarray | None
- add_reference_lines_to_display()[source]
See
ShankView.add_reference_lines_to_display()for details.- Return type:
None
- align_reference_lines_and_points()[source]
See
ShankView.align_reference_lines()for details.- Return type:
None
- create_reference_line_and_point(*args, **kwargs)[source]
See
ShankView.create_reference_line_and_point()for details.- Return type:
tuple
- delete_reference_line_and_point(*args)[source]
See
ShankView.delete_reference_line_and_point()for details.- Return type:
None
- get_scaled_histology()[source]
See
ShankHandler.get_scaled_histology()for details.- Return type:
None
- get_yaxis_lims()[source]
Get the y-axis limits from the model.
- Returns:
The ymin and ymax values from the model
- Return type:
list[float, float]
- match_feature_line(*args)[source]
See
ShankView.match_feature_line()for details.- Return type:
tuple[int|None,list|ndarray|None]
- match_track_line(*args)[source]
See
ShankView.match_track_line()for details.- Return type:
int|None
- offset_hist_data(*args)[source]
See
ShankHandler.offset_hist_data()for details.- Return type:
None
- plot_channels(fig_slice, colour=None)[source]
Plot channels on a slice plot.
- Parameters:
fig_slice (pg.ViewBox) – The slice fig to add the channel items to
colour (str) – The colour of the scatter points used to plot the channels
- Return type:
None
Notes
fig_slice is passed in as a parameter as for the dual config display the channels
plotted on a different slice figure than the one stored in the view.
- plot_feature(plot_key)[source]
Plot a feature plot.
- Parameters:
plot_key (str) – The key of the plot to display
- Return type:
None
- plot_histology()[source]
Plot the histology plot.
- Returns:
A pg.LinearRegionItem corresponding to the second last brain region added to the histology plot
- Return type:
pg.LinearRegionItem
- plot_image(plot_key, levels=None)[source]
Plot an image plot.
- Parameters:
plot_key (str) – The key of the plot to display
levels (
list|None) – The levels used to scale the colorbar on the plot
- Returns:
cbar – The colobar abject that was added to the plot
- Return type:
- plot_line(plot_key)[source]
Plot a line plot.
- Parameters:
plot_key (str) – The key of the plot to display
- Return type:
None
- plot_probe(plot_key, levels=None)[source]
Plot a probe plot.
- Parameters:
plot_key (str) – The key of the plot to display
levels (
list|None) – The levels used to scale the colorbar on the plot
- Returns:
cbar – The colobar abject that was added to the plot
- Return type:
- plot_scale_factor()[source]
Plot the scale factor along the probe.
- Returns:
cbar – The ColorBar object added to the plot
- Return type:
- plot_scatter(plot_key, levels=None)[source]
Plot a scatter plot.
- Parameters:
plot_key (str) – The key of the plot to display
levels (
list|None) – The levels used to scale the colorbar on the plot
- Returns:
cbar – The colobar abject that was added to the plot
- Return type:
- plot_slice(plot_key)[source]
Plot a slice plot showing a coronal slice through the brain.
- Parameters:
plot_key (str) – The key of the plot to display
- Return type:
tuple[ViewBox,ImageItem,ColorBar]- Returns:
fig (pg.ViewBox) – The viewbox that contains the image
img (pg.ImageItem) – The image item that was added to the plot
cbar (ColorBar) – The colobar object that was added to the plot
- property points: list[ScatterPlotItem]
Return the points stored in the view.
- remove_reference_line(*args)[source]
See
ShankView.remove_reference_line()for details.- Return type:
None
- remove_reference_lines_from_display()[source]
See
ShankView.remove_reference_lines_to_display()for details.- Return type:
None
- scale_hist_data(extend_feature, lin_fit)[source]
Scale brain regions along the probe track based on reference lines.
- Parameters:
extend_feature (float) – Amount to extend for linear fit
lin_fit (bool) – Whether to use a linear fit or not
- Return type:
None
- set_feature_title(feature_title)[source]
See
ShankView.set_feature_title()for details.- Return type:
None
- set_probe_lims()[source]
Set the limits for the probe tip and probe top based on values stored in model.
- Return type:
None
- set_scale_title(hover_item)[source]
Update the title of the scale plot color bar based on the hovered region.
- Parameters:
hover_item (pg.LinearRegionItem) – The region item currently hovered over.
- set_xaxis_range(fig)[source]
Set the x-axis range of the specified figure.
- Parameters:
fig (str) – The attribute name of the figure to set the x-axis for
- Return type:
None
- set_yaxis_range(fig)[source]
Set the y-axis range of the specified figure.
- Parameters:
fig (str) – The attribute name of the figure to set the y-axis for
- Return type:
None