Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customization of roi handles #4083

Open
kklmn opened this issue Mar 15, 2024 · 3 comments
Open

Customization of roi handles #4083

kklmn opened this issue Mar 15, 2024 · 3 comments

Comments

@kklmn
Copy link

kklmn commented Mar 15, 2024

Hello,

In connection to PlotWindow, I want to create a set of data correction tools for 1D curves. I imagine four tools in it:

  1. delete data points within a given range,
  2. vertically scale data points within a given range,
  3. step correction,
  4. replace data points in a region by a spline.

To display these tools in PlotWindow, I need something similar to silx’s rois. In all four cases this would be a horizontal range roi with two draggable vertical lines, and additionally one handle for (2) to drag it vertically and n handles for (4) representing the spline nodes that would be draggable in all directions or only vertically.

Please advise very sketchy on how to modify HorizontalRangeROI to add custom draggable handles and emit custom Qt signals.

Thank you in advance!

@vallsv
Copy link
Contributor

vallsv commented Mar 26, 2024

Hi Konstantin,

I think it's already the case.

You have signal send whenever a ROI region change.
You also have signals to catch user interaction.

    sigRegionChanged = qt.Signal()
    """Signal emitted everytime the shape or position of the ROI changes"""

    sigEditingStarted = qt.Signal()
    """Signal emitted when the user start editing the roi"""

    sigEditingFinished = qt.Signal()
    """Signal emitted when the region edition is finished. During edition
    sigEditionChanged will be emitted several times and 
    sigRegionEditionFinished only at end"""

Everything is inherited from silx/gui/plot/items/_roi_base.py

@kklmn
Copy link
Author

kklmn commented Mar 26, 2024

Hi Valentin,

Yes, no doubt that what is implemented does work as it should and it sends signals. :)

My question was how to add custom handles to a roi -- those draggable marks in the plot that interact with the mouse.

@vallsv
Copy link
Contributor

vallsv commented Mar 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants