-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Morphological snakes #4175
base: main
Are you sure you want to change the base?
Morphological snakes #4175
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. |
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_fm
with 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