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

ROI to select fitting range #21

Open
HanHsuanWu opened this issue Jan 9, 2024 · 1 comment
Open

ROI to select fitting range #21

HanHsuanWu opened this issue Jan 9, 2024 · 1 comment

Comments

@HanHsuanWu
Copy link
Contributor

Describe the functionality you would like to see.

As title, it will be nice to be able to use ROI to select the fitting range of a EELS model. Something like what GMS can do for background subtraction. Would it possible to do it with SpanROI that we have currently?
image

Additional information

This is on the '2.0.dev0' version. It seems like ROI doesn't work with model1D object right now.

s = hs.datasets.two_gaussians()
m = s.create_model()
roi = hs.roi.SpanROI()
m.plot()
sliced_signal = roi.interactive(m, axes=m.axes_manager.signal_axes)

image

image

@francisco-dlp
Copy link
Member

@HanHsuanWu, thank you for the suggestion.

You can set the fitting range interactively using set_signal_range. If you don't pass the signal range as an argument, it automatically displays a ROI to select the signal range for fitting. Does it meet you needs?

That said, this feature predates HyperSpy ROIs, and, therefore, it is not implemented using ROIs. I think that it would be good to reimplement the feature using ROIs instead. The same goes for all other functionality using interactive_range_selector. However, this is a discussion to have in the hyperspy repository.

Also, the fact that using ROIs on a Model raises an obscure exception is a bug: it should either work (not currently implemented) or raise an informative NotImplemented exception. Again, this is HyperSpy issue.

@HanHsuanWu, would you like to open those issues in the HyperSpy repository?

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