Skip to content

Intensity profile: "Reset selection" does not clear the previous selection #322

Description

@ThomasMalletCodra

Describe the bug

In the Analysis > Intensity profiles menu, the "Reset selection" button does not properly clear the previous selection. After resetting and drawing a new region, the resulting profile still corresponds to the first selection rather than the newly drawn one.

To Reproduce

  1. Create one or more Gaussian images using the Create menu
  2. Open Analysis > Intensity profiles > Average profile... (or Line/Segment profile)
  3. Draw a selection zone on the image and click OK — a signal is created in the Signal panel with the correct profile
  4. Re-open Analysis > Intensity profiles > Average profile...
  5. Click Reset selection
  6. Draw a different selection zone on the image
  7. Click OK

Result: The profile created in the Signal panel corresponds to the first selection (step 3), not the newly drawn zone (step 6).

Expected behavior

After clicking "Reset selection" and drawing a new zone, the extracted profile should correspond to the new selection. The old selection parameters should be fully discarded.

Screenshots

No screenshots provided.

Installation information

  • Reported by external user
  • Observed on standard DataLab installation

Additional context

  • Affected component: DataLab (profiledialog.py — ProfileExtractionDialog.reset_to_initial)
  • Likely root cause: In reset_to_initial(), self.shape is deleted from the plot but the reference is not set to None. When __tool_job_finished fires after the new selection, get_last_final_shape() may return a stale reference, or the old shape coordinates persist in self.param through shape_to_param().

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions