Skip to content

Separate plot windows don't use same aspect ratio configuration as integrated plot #287

@PierreRaybaut

Description

@PierreRaybaut

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

  1. Updated ImagePlotHandler.get_plot_options() to include the current aspect ratio and lock status from the plot
  2. Updated ImageBackgroundDialog to accept plot options as a parameter
  3. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions