educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
63 stars 21 forks source link

Application breaks when using segmentation tool #6

Closed tomhsiao1260 closed 1 year ago

tomhsiao1260 commented 1 year ago

I've followed tutorial3 in Vesuvius Challenge. However, when I use the segmentation tool in the following step

guide

the application breaks, here's a short film

https://user-images.githubusercontent.com/31985811/226015237-88d92832-c184-458e-9605-653e8bcaf887.mp4

. . Not sure if it's relevant, but this is how I installed it 👉 https://github.com/educelab/volume-cartographer/issues/5 And my device information:

macOS: Ventura 13.2.1 CPU: 2.3 GHz dual Intel Core i5 GPU: Intel Iris Plus Graphics 640

btw, thanks to the people behind the scenes and their difficult progress in the past to achieve this challenge 🙏 Can't wait to see what happen in the next few years 🚀

csparker247 commented 1 year ago

Try making a new segmentation on slice 1 instead of 0 and let me know what happens.

EDIT: Oh, and please zip up the segmentation directory inside *.volpkg/paths/ and send that to me so I can test a fix.

tomhsiao1260 commented 1 year ago

I switch to slice 1 and do it again and it works well. So I come back to slice 0 to do another new segmentation again and it works as well. The following is the path folder:

20230318015423: slice0 (not work) 20230318042534: slice1 (work) 20230318042733: slice0 (work)

paths.zip

csparker247 commented 1 year ago

Great, thanks!

I think the segmentation algorithm throws an exception if a point goes out of the volume bounds. On slice 0, the point doesn't have to go very far to be considered OOBs, so that's probably what's happening here, and we're not catching/handling the exception.

Given you got a different segmentation to work on slice zero (and so did we for the tutorial), it's probably conditional on the exact pointset used.

A good workaround is to go a few slices in and start from there. You don't lose much by doing that. If you go one slice in, you lose about one row of pixels from the final 2D result.

csparker247 commented 1 year ago

Thanks for giving me your segmentations. It helped me fix a number of potential bugs. One thing I hadn't seen before is that your segmentation had adjacent, duplicate points:

https://user-images.githubusercontent.com/1434526/226426812-c5e90dbc-f3c9-4846-8e6b-4271b8f846f8.mp4

This was causing some backend curve interpolation code to create a point outside of the volume, which lead to an uncaught exception, which crashed the program.

I've done a number of things in #8 to fix all of these compounded issues. Thanks again for reporting!

tomhsiao1260 commented 1 year ago

Glad to know my segmentations data can help. Great work & thanks for the quick fix.