stardist / stardist-imagej

StarDist plugin for ImageJ
BSD 3-Clause "New" or "Revised" License
27 stars 14 forks source link

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

Open hkmoon opened 3 years ago

hkmoon commented 3 years ago

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.

uschmidt83 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

hkmoon commented 3 years ago

@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!