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

Show/hide ImageView side histogram #3488

Merged
merged 9 commits into from Jun 29, 2021

Conversation

vallsv
Copy link
Contributor

@vallsv vallsv commented Jun 11, 2021

This MR provide an API to show/hide the side histogram of the ImageView.

It is added as a tool in the toolbar, and a new entry in the (image view main window)

Screenshot from 2021-06-11 13-27-30

Changelog:

  • Added an action to show/hide the side histogram of the ImageView
  • Few clean up around ImageView module
  • Update the imageview example with a --live option
  • Added resetzoom to ImageView.setImage

@vallsv vallsv requested a review from t20100 June 11, 2021 11:27
@vallsv vallsv changed the title Hide show side histogram Show/hide ImageView side histogram Jun 11, 2021
@vallsv
Copy link
Contributor Author

vallsv commented Jun 11, 2021

I have replaced layout.addWidget(self._histoVPlot.getWidgetHandle(), 0, 1) by layout.addWidget(self._histoVPlot, 0, 1).
I think it only makes sens for the main widget.

@t20100
Copy link
Member

t20100 commented Jun 17, 2021

I have replaced layout.addWidget(self._histoVPlot.getWidgetHandle(), 0, 1) by layout.addWidget(self._histoVPlot, 0, 1).

Sounds good. I think it was there to really make sure there is no additional margins in PlotWidget which would make the histograms not aligned with the image plot, but it should not be needed.

I'd move ShowSideHistogramsAction outside of silx.gui.plot.actions since all actions in silx.gui.plot.actions are compatible with PlotWidget.
I would put it as a private class in ImageView.py as it is only used there, else eventually in a dedicated module in silx.gui.plot.actions.

@vallsv
Copy link
Contributor Author

vallsv commented Jun 28, 2021

This can be reviewed.

I did some cleanup around the ImageView.

The main weird change is the setStartusBar(None) that i have removed. This was creating blinking cause just before it is set to something. So i dont know if it have to be displayed or not.

The other change is the use of setImage(resetzoom), instead of reset, for consistency with the other plot API. I don't like much the resetzoom, but i think it is better to be share the same API. reset is still working.

@t20100 t20100 merged commit 3ced0c0 into silx-kit:master Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants