Separate plot windows don't use same aspect ratio configuration as integrated plot
Description
When using non-uniform coordinates on images, the aspect ratio is correctly configured in the integrated plot handler (aspect ratio is unlocked to allow proper display). However, this configuration was not being applied to separate plotting windows such as:
- "View in a new window" feature
- ROI Editor dialogs
- ROI Grid Editor
- Profile extraction dialogs
- Image background selection dialog
This caused images with non-uniform coordinates to display incorrectly in these separate windows.
Root Cause
The ImagePlotHandler.get_plot_options() method was not including the aspect_ratio and lock_aspect_ratio settings from the current plot configuration. These settings are dynamically determined based on whether the displayed images use uniform or non-uniform coordinates.
Solution
- Updated
ImagePlotHandler.get_plot_options() to include the current aspect ratio and lock status from the plot
- Updated
ImageBackgroundDialog to accept plot options as a parameter
- Updated callers (
compute_offset_correction, create_roi_grid) to pass plot options to the dialogs
Files Changed
datalab/gui/plothandler.py - Added aspect ratio settings to get_plot_options()
datalab/widgets/imagebackground.py - Added options parameter to constructor
datalab/gui/processor/image.py - Pass plot options to ImageBackgroundDialog and ImageGridROIEditor
Testing
- All existing image tests pass
- Tested with non-uniform coordinate images in separate windows
Separate plot windows don't use same aspect ratio configuration as integrated plot
Description
When using non-uniform coordinates on images, the aspect ratio is correctly configured in the integrated plot handler (aspect ratio is unlocked to allow proper display). However, this configuration was not being applied to separate plotting windows such as:
This caused images with non-uniform coordinates to display incorrectly in these separate windows.
Root Cause
The
ImagePlotHandler.get_plot_options()method was not including theaspect_ratioandlock_aspect_ratiosettings from the current plot configuration. These settings are dynamically determined based on whether the displayed images use uniform or non-uniform coordinates.Solution
ImagePlotHandler.get_plot_options()to include the current aspect ratio and lock status from the plotImageBackgroundDialogto accept plot options as a parametercompute_offset_correction,create_roi_grid) to pass plot options to the dialogsFiles Changed
datalab/gui/plothandler.py- Added aspect ratio settings toget_plot_options()datalab/widgets/imagebackground.py- Addedoptionsparameter to constructordatalab/gui/processor/image.py- Pass plot options toImageBackgroundDialogandImageGridROIEditorTesting