Repository navigation
Morphological snakes - #4175
Morphological snakes#4175axarekma wants to merge 13 commits into
Conversation
|
@axarekma Thanks for this and welcome to scikit-image! 😊 I'm very excited to get Chan-Vese segmentation in 3D! Having said that, we generally don't accept bare C code into scikit-image, because we have found it is much more difficult to maintain than Python or Cython. What little is in the repo is there for historical reasons. (And even if we did take C code, we would probably aim to avoid macros!) So, this could would need to be significantly re-worked before getting merged. Do you have the bandwidth to port the C code to Cython? Another question I have is whether this is a pure speedup of Chan-Vese or actually a change in behaviour? If it is only a speedup (to within numerical accuracy), then I would aim to replace the existing function, rather than create a new function. If you want to iterate to get it merged, we will be very happy to help you! My main comments are:
I think this is a very valuable contribution, so I would keep it open whether you have time to keep working on it or not! |
|
Thanks for the comments @jni. This is one of those methods I have been searching for some time to find a decent 3D implementation of (in vain), so I ended up writing up something in C++/pybind11 for personal use a while ago. The PR was basically a minimal edit to that package to make it compatible with scikit-image which explains the stylistic differences. The internal c++ logic is minimal, so porting it to cython should not be that big of a hassle. However, I have no idea if I have the time to do that in the near future. For most use cases the module is a pure speedup of the python implementation.
As for the macros, I have to admit I did not do my due diligence of checking if there is noticeable overhead by switching to functions. |
|
We have changed the base branch for this PR from the Summary - what this means for your PRYou can continue to work on your PR, now based on Once we've merged your PR into the In addition - our automated script detected that your branch had merge conflicts with the pre-Megamove branch. Please make sure to merge in the Read on for the Megamove rationale, and more detailed instructions. DetailsRationaleWe've changed the base branch to make it easier and smoother to continue to work on your PR, while we work through a rather large change in the directory structure of the repository - a change that we have called Megamove. See the Megamove explanation issue for more detail. Changing the base branch means you do not see merge conflicts related to the Megamove change, and can continue to work with the repository in its original state, without worrying about porting those changes across to the new post-Megamove structure. As you'll see in the linked issue, you can continue to work on your PR as before, and you can continue to use the Github GUI to "Update branch" - this updates from the new To emphasize again, do not try and merge the scikit-image When we've approved your PR, we'll merge into the Any questions, please reply here. |
Description
This PR contains a fast marching version of morphological_chan_vese based on propagation a vector of edge pixels/voxels. It is implemented as a parallel module
skimake.segmentation.morphological_chan_vese_fmwith the same interface as the original.
Credit where credit is due: design is heavily based on the source from:
This version extends it to 3D and has modified boundary conditions to conform with the scipy defaults for the morphologgical operators.
Extension to the existing version:
All the boolean operators are based on level_set==1 comparison, so passing an initial mask with value \notin {0,1} removes this region from the propagation and averages.
A quick and dirty benchmark on use-cases resulted in:
Checklist
./doc/examples(new features only)./benchmarks, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py.doc/release/release_dev.rst.@meeseeksdev backport to v0.14.x