mplview.core module¶
-
class
mplview.core.
MatplotlibViewer
(*args, **kwargs)[source]¶ Bases:
matplotlib.figure.Figure
Provides a way to interact with numpy arrays pulled from neuron images.
Wraps a Matplotlib figure instance.
-
color_range_update
(vmin, vmax)[source]¶ Handles an update to the vmin and vmax range based on the selection provided.
Parameters: - the min value selected (vmin) –
- the max value selected (vmax) –
-
format_coord
(x, y)[source]¶ Include intensity when showing coordinates during mouseover.
Parameters: - x (float) – cursor’s x position within the image.
- y (float) – cursor’s y position within the image.
Returns: coordinates and intensity if it can be gotten.
Return type: str
-
get_image
(i=None)[source]¶ Gets the current image or the image if it is a projection.
Parameters: i (int) – image to retrieve (defaults to selection). Returns: the current image. Return type: numpy.ndarray
-
Bases:
object
Sets time to min_time.
Parameters: Matplotlib event that caused the call to this callback. (event) –
Disconnects the given cid from being notified of time updates.
Parameters: ID of callback to pull (cid) –
Sets time to max_time.
Parameters: Matplotlib event that caused the call to this callback. (event) –
Sets time to one time_step after.
Parameters: Matplotlib event that caused the call to this callback. (event) –
Takes the time value and normalizes it to fit within the range. Then, makes sure it is a discrete number of steps from the min_time.
Parameters: float position from the slider bar to correct (val) – Returns: the normalized value. Return type: int
Registers a callback function for notification when the time is updated.
Parameters: func (callable) – function call when the time is updated Returns: - a callback ID or cid to allow pulling the
- callback when no longer necessary.
Return type: int
Sets time to one time_step prior.
Parameters: Matplotlib event that caused the call to this callback. (event) –
Takes the time value and normalizes it within the range if it does not fit.
Parameters: float position from slider bar to move to (val) –