The magnetic lasso tool was lost in the port to Qt4. The code was in bad shape, but there is a working version in https://phabricator.kde.org/D241. Before it is possible to add to Krita as an experimental feature, the magnetic lasso tool will need an internal rework, including an implementation of the A* algorithm. I would suggest looking at Dmitry's implementation of the watershed algorithm to see how to do a fast parallel implementation of an image processing algo inside a tool.
The main thing that needs work is ergonomics, which is all about finding a really nice "edge detection" algorithm and weighting scheme. You need to be clever about how you do "edge detection" - a simple Sobel filter gives really rough noisy results. To get a good result you'll want to find edges based on hue and value changes separately at a minimum, maybe mix different edge detection filters, or other clever stuff, you'd need to play with it. Another ergonomic concern is figuring out the timing of "commits" where the lasso path freezes and you start your A* path search in the next section.
Here are a few papers about high quality edge detection. They seem way too bright and shiny for something as old as the magnetic lasso, but perhaps they cite other interesting, older methods that could be useful for realtime applications.
- Crisp Boundary Detection Using Pointwise Mutual Information
- Fast Edge Detection Using Structured Forests
- DeepEdge (2014)
After all that, it will need:
- New icons
- New cursors
- Redesign of the on-screen feedback