seung-lab / connected-components-3d

Connected components on discrete and continuous multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants; periodic boundaries (4, 8, & 6)
GNU Lesser General Public License v3.0
375 stars 43 forks source link

Additional metrics support #108

Closed drusmanbashir closed 11 months ago

drusmanbashir commented 1 year ago

Hi, I am benefiting from this amazing library in my deep learning research, namely detecting and measuring liver tumours in CT scans. It would be great if we could have a features allowing unitless longest dimension, surface area metrics to be computed as well. Getting volume is easy since the functions already return voxel counts for labels.

william-silversmith commented 1 year ago

Hi!

I'm glad this library is helpful! Total surface area is a good idea. You can get that by manipulating the output of contacts, but a dedicated function would be ideal. Longest dimension is a bit out of scope, but I think you can get it from performing a principal components analysis for example using scikit-learn:

https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html

Will

william-silversmith commented 11 months ago

Closing due to lack of activity. Please re-open if you'd like more info.