segmenteverygrain icon indicating copy to clipboard operation
segmenteverygrain copied to clipboard

Made some changes to the manual editing interface

Open dirtbirb opened this issue 10 months ago • 3 comments

As part of my own project that relies on segmenteverygrain, I've made some additions to the manual editing interface and wanted to see if it would be useful to upstream them.

Additions:

  • Increased FPS, especially with high grain counts
  • Using the same interface to create, delete, merge, and measure grains
  • More control over grain detection, including a selection box and arbitrary numbers of foreground/background prompts
  • A toggleable info box to display information about the last-selected grain
  • Undoing the most recently-created grain
  • Avoids resetting the zoom level when creating a grain

Currently, these changes are implemented in a sub-module imported as segmenteverygrain.interactions, which contains Grain and GrainPlot classes. Each Grain keeps track of its own data and plot representation, while the GrainPlot handles display and manipulation. The module also has some functions to manage saving and loading data in a consistent way.

If some or all of these features would be useful, I can create better documentation and figure out how best to package things into a pull request. I can also add new features or restructure things in a way that's easier to integrate. If this is more complex than desired or otherwise out of scope, I can try and repackage it as a separate add-on.

My larger project also includes a GUI (built in Kivy) and a way to do an automated point count (for easy comparison with other grain-counting methods), so those can be discussed as well if they're interesting.

Any feedback is welcome!

dirtbirb avatar Feb 25 '25 22:02 dirtbirb

Hi @dirtbirb - this looks great! I especially like the improved interactivity when manually selecting / deleting / merging / adding grains. It would be good to get at least some of this into the main repo.

zsylvester avatar Mar 04 '25 19:03 zsylvester

Great, I'll assemble a pull request with the interactive part first.

dirtbirb avatar Mar 05 '25 19:03 dirtbirb

Submitted! Let me know if anything should change.

dirtbirb avatar Mar 21 '25 21:03 dirtbirb

Hi @dirtbirb - I just merged your pull request. I really like the new interactive plot. I am going to run some more tests but this seems significantly more user friendly and faster than what I had before. Once I figured out how exactly everything works, I am planning on updating the original notebook so that it relies on your interface. Thanks for contributing this!

zsylvester avatar Aug 29 '25 19:08 zsylvester

I'm closing this as the pull request has been merged.

zsylvester avatar Sep 28 '25 20:09 zsylvester