Repository navigation
MRG: 3D skeletonization - #1923
Conversation
|
@ev-br thanks for the contribution! This looks really interesting! Regarding tests: I'm not sure that adding binaries and extra images is a good option. Couldn't the tests be re-implemented using the images we already provide? BTW, code for the testing is really hard to read and will be a pain to support. I'd suggest to remove visualization feature from it and make it as planar as possible. I haven't review the Cython code, leaving it to the more experienced devs. |
There was a problem hiding this comment.
Hmm, it appears that not so many things are happening in _prepare_image and _postprocess_image. I would prefer to put all processing in a single function.
|
Tests: sure, the plotting will go (was useful when debugging, not needed anymore). Sure, if there are some images already, it'd be good to reuse --- can you point me to where they are? I'd also appreciate an advice on how to deal with Bento: 0b7de82 can't be correct since .pyx file is an implementation detail. I note that scipy bento.info only lists .c files (and numpy's bento.info is gone as of this Fall). I'm also a bit baffled by the test failure on python 2.7 on Travis. It barfs on the typed tuple which should be supported by a recent enough cython, while there is no problem on python 2.6 on Travis or locally on python 2.7 / cython 0.23.4 |
|
@ev-br sure, there are plenty of images provided by the package - https://github.com/scikit-image/scikit-image/tree/master/skimage/data . |
|
I wrote to the author of the bat chochlea image set, but heard nothing back
:/ We don't have a lot of 3D test data, so if we can find a small test set
to add, that'd be good. We may also have to start thinking of data
packages, and hosting them externally.
|
77cf385 to
146be23
Compare
|
I believe I addressed all review comments, so from my end this is ready. The Bat Cochlea dataset is gone because the license is unclear. Ad hoc datasets are gone too. To have some testing for actual 3D case, I dropped an ad hoc image to the |
| * @version 1.0 11/13/2015 (unique BSD licensed version for scikit-image) | ||
| * @author Ignacio Arganda-Carreras (iargandacarreras at gmail.com) | ||
|
|
||
| Porting to Cython was done by Evgeni Burovski ([email protected]). |
There was a problem hiding this comment.
Would you mind adding your name to CONTRIBUTORS.txt?
There was a problem hiding this comment.
Seconding this. In scikit-image, we keep track of all contributors in CONTRIBUTORS.txt.
|
This is excellent work, thank you Evgeni. I'd like @ahojnnes to look over this before it goes in, but I think it is ready to go. |
| if img[p, r, c] != 1: | ||
| continue | ||
|
|
||
| is_border_pt = (curr_border == 1 and img[p, r, c-1] <= 0 or #N |
There was a problem hiding this comment.
Good point, thanks! Was just a leftover from semi-automated transition from Java code (and no idea why it is there). Changed.
|
Thanks @ev-br, I've only left couple of minor comments. |
| int[::1] lut): | ||
| """Check if a point is Euler invariant. | ||
|
|
||
| Calculate Euler characteristc for each octant and sum up. |
There was a problem hiding this comment.
I started thinking "ugh, a text editor plugin for spell checking the comments only would be nice" --- only to discover that my text editor (gedit) does have exactly this plugin. Thanks for nudging me to look for it! Done, here and elsewhere.
|
I have a few very minor comments. Other than that this looks very good! I would love to see an example in the gallery for this. |
Remove ad-hoc images from morphology/tests/data folder. Add a FIJI generated image to skimage/data. The image was generated via >>> img = binary_blobs(32, 0.05, n_dim=3, seed=1234) >>> img = img.astype(np.uint8)*255 >>> img = img[:-2, ...] then saved as a sequence of png frames, read into FIJI as an image sequence, and skeletonized via Plugins -> Skeletonize (2D/3D).
* typos in comments * handle the corner case of width-1 2D image * vanity * change up leftover <= to correct ==
Use recommended idioms in the .py wrapper
|
Rebased. |
|
@ivoflipse I guess extra branches can be at least to some extent taken care of by some postprocessing heuristics. W.r.t. runtime, I believe there are no major bottlenecks left, even though there is definitely room to improve the runtime, possibly quite significantly. |
|
Mayavi is what I used during my PhD for 3d viz. Today I'd take a hard look at VisPy, which is reaching the point of maturity. |
|
Mayavi is just a Pythonic wrapper around VTK, not sure if they already updated to VTK 7 which finally brings Python 3 support. VisPy looks nice, but doesn't aim to support the web. |
|
I'm +1 on merging.
|
|
@ev-br looks like there's some build issues with the templating in the rebased version... |
It got botched sometime around reviewing/merging/rebasing of scikit-imagegh-1924
|
@jni should be fixed now. |
|
Sweet! Awesome, thank you for this great addition, @ev-br! =) |
|
Good stuff, thanks Evgeni! |
|
Fantastic code review -- thanks a lot! |
Add a skeletonization algorithm for 2D and 3D images, based on the ImageJ Skeletonize3D plugin, http://fiji.sc/Skeletonize3D
As suggested by Stefan, this PR is a continuation of https://github.com/scikit-image/skeleton_3D/pull/3.
(b00c6be and further commits were added after the review in https://github.com/scikit-image/skeleton_3D/pull/3).
This is WIP, as it needs at least
Since this is my first scikit-image contribution, I'm sure there are lots of issues :-). For starters, I'm adding several data files for testing --- what is the policy here?
This PR also includes a tweak to the build system, which I'll submit as a separate PR in a minute for the ease of reviewing. If that other PR is merged separately, I'll rebase this one.