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

Added Preview function for on-the-fly update ROIs #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

hkmoon
Copy link

@hkmoon hkmoon commented Jul 8, 2021

The preview function would be useful for checking the optimal parameters while opening the dialog.
It updates ROIs when the slide bar values are changed as well as the cancel button is also added when the user does not want the output.

As well as the cancel button is also added.
@uschmidt83
Copy link
Member

Hi @hkmoon,

thanks for the PR. I guess you intended this feature to be used with small images where the computation finishes quickly?
Ideally, one could even cache the neural network computation and only run the non-maximum suppression (if only parameters related to that have changed). But this can only work if we can detect which parameters have changed.

PS: When changing the parameters, I sometimes got an exception related to AWT/Swing. Maybe because the GUI is updating too frequently?

image

Frequent preview() call might the system unstable.
And, it is only useful for small images.
@hkmoon
Copy link
Author

hkmoon commented Jul 9, 2021

Hi @uschmidt83

You are right. I used blobs.gif for demonstration of StarDist in the summer school and the preview would be a good way to find the optimal parameters for the users. But, I did not think of big images. If you think the preview function is called too frequently, supposedly, "update" button might be better.

I got the error message as well. It happened because the module added additional ROIs without reset(). Hopefully, it will be useful for other users too.

@uschmidt83
Copy link
Member

Thanks, I'll be on vacation next week and take a look when I'm back. Please ping me if I forget!

@hkmoon
Copy link
Author

hkmoon commented Jul 11, 2021

@uschmidt83
I added the Previewable implementation just in case. You can choose your favorable way for the preview of either Button or Checkbox.
Have a nice vacation!

private void refresh() {
final HashMap<String, Object> params = new HashMap<>();

params.put("input", input);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For timelapse input data: should the preview only be for the current frame (how to even get that?) or the entire sequence (potentially slow)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the actual processing logic of StarDist. Does it probably take into account of whole timeseries of the input image? Then, it will be slow as you expected. How do you handle ROIs over time in this case?

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

Successfully merging this pull request may close these issues.

2 participants