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

Returning optimized light subcomponents from model plot #495

Open
amn3142 opened this issue Aug 15, 2023 · 3 comments
Open

Returning optimized light subcomponents from model plot #495

amn3142 opened this issue Aug 15, 2023 · 3 comments

Comments

@amn3142
Copy link
Contributor

amn3142 commented Aug 15, 2023

What would the best way be to get the subcomponents from model plot as arrays? I see how to get them as separate plots, but I would like to just have the arrays myself.

There's probably a way to extract the data from the image figure, but I think adding in an option to return array might also be useful in model plot. Does such an option already exist?

Motivation: I want to make a lot of modifications to how I am plotting including things like overall normalization and fov that I think will be easier for me to handle in a uniform way on my own.

Thanks in advance.

@sibirrer
Copy link
Collaborator

Hi @amn3142,
this class might be of interest to you:

class MultiBandImageReconstruction(object):

You can generate then individual ImageModel classes with all the solution in there and then you can execute individual components.

@amn3142
Copy link
Contributor Author

amn3142 commented Aug 16, 2023

It was just a couple of lines of code to get the decomposition plot in model plot to return arrays rather than a figure when a new 'return_array' boolean was set.

It is hacky because I still create and pass it an axis object that goes unused, but it works without me having to think so that's a major plus. I can submit a pull request if you think it would be a useful feature for others.

@sibirrer
Copy link
Collaborator

Hi @amn3142, great to hear it worked! You can still make a PR, that could help make the design be improved for 'less of a hack' perhaps in the future, and also to make sure your feature is forward compatible. Thank you!

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