Skip to content

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

Open
hkmoon wants to merge 6 commits intostardist:masterfrom
hkmoon:master
Open

Added Preview function for on-the-fly update ROIs#12
hkmoon wants to merge 6 commits intostardist:masterfrom
hkmoon:master

Conversation

@hkmoon
Copy link
Copy Markdown

@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.
Comment thread src/main/java/de/csbdresden/stardist/StarDist2D.java Outdated
@uschmidt83
Copy link
Copy Markdown
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

hkmoon added 3 commits July 9, 2021 14:34
Frequent preview() call might the system unstable.
And, it is only useful for small images.
@hkmoon
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

Comment thread src/main/java/de/csbdresden/stardist/StarDist2D.java
private void refresh() {
final HashMap<String, Object> params = new HashMap<>();

params.put("input", input);
Copy link
Copy Markdown
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
Copy Markdown
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