epyr.baseline.interactive
Interactive region selection for baseline correction.
This module provides matplotlib-based interactive widgets for selecting baseline regions in Jupyter notebooks and desktop environments.
Functions
Utility function to close RegionSelector windows in Jupyter notebooks. |
|
|
Convenience function for interactive 1D region selection. |
|
Convenience function for interactive 2D region selection. |
Check if interactive selection is available in the current environment. |
|
Display help for using interactive region selection in Jupyter notebooks. |
|
Set up the best available interactive backend for the current environment. |
Classes
Interactive region selector for baseline correction. |
- class epyr.baseline.interactive.RegionSelector[source]
Interactive region selector for baseline correction.
This class provides matplotlib-based interactive region selection for both 1D and 2D EPR data. It handles matplotlib version compatibility and provides multiple methods to close selection windows.
- select_regions_1d(x, y, title='Select regions to EXCLUDE from baseline fitting')[source]
Interactive selection of 1D regions.
- Parameters:
x – X-axis data
y – Y-axis data
title – Plot title with instructions
- Returns:
Selected regions as [(x1, x2), …]
- Return type:
- select_regions_2d(x, y, z, title='Select regions to EXCLUDE from baseline fitting')[source]
Interactive selection of 2D regions.
- Parameters:
x – X-axis coordinates (1D array or meshgrid)
y – Y-axis coordinates (1D array or meshgrid)
z – 2D data array
title – Plot title with instructions
- Returns:
Selected regions as [((x1,x2), (y1,y2)), …]
- Return type:
- epyr.baseline.interactive.interactive_select_regions_1d(x, y, title='Select regions to EXCLUDE from baseline fitting')[source]
Convenience function for interactive 1D region selection.
- Parameters:
x – X-axis data
y – Y-axis data
title – Plot title
- Returns:
Selected regions as [(x1, x2), …]
- Return type:
- epyr.baseline.interactive.interactive_select_regions_2d(x, y, z, title='Select regions to EXCLUDE from baseline fitting')[source]
Convenience function for interactive 2D region selection.
- Parameters:
x – X-axis coordinates
y – Y-axis coordinates
z – 2D data array
title – Plot title
- Returns:
Selected regions as [((x1,x2), (y1,y2)), …]
- Return type:
- epyr.baseline.interactive.close_selector_window()[source]
Utility function to close RegionSelector windows in Jupyter notebooks.
Use this if the interactive region selector gets stuck or won’t close.
- epyr.baseline.interactive.jupyter_help()[source]
Display help for using interactive region selection in Jupyter notebooks.