Closed sedghi closed 1 week ago
This seems like a great feature!
This type of surface rendering seems already available in cornerstone3d:
Cornerstone Demo: https://www.cornerstonejs.org/live-examples/surfacerendering
Code in cornerstone that convert labelmap to surface (vtk polydata): https://github.com/cornerstonejs/cornerstone3D/blob/2c4efae4c977bf6df9ca7399b6c6e715ab3f899d/packages/tools/src/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.ts#L81
It seems to use the polyseg implementation of the Flying Edges algorithm: https://github.com/cornerstonejs/cornerstone3D/blob/2c4efae4c977bf6df9ca7399b6c6e715ab3f899d/packages/tools/src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts#L44
Specifically calling ICRPolySeg functionality: https://github.com/cornerstonejs/cornerstone3D/blob/2c4efae4c977bf6df9ca7399b6c6e715ab3f899d/packages/tools/src/workers/polySegConverters.js#L56
from the polyseg-wasm library: https://github.com/cornerstonejs/cornerstone3D/blob/2c4efae4c977bf6df9ca7399b6c6e715ab3f899d/packages/tools/src/workers/polySegConverters.js#L4
This uses vtkDiscreteFlyingEdges3D
(a faster implementation of the Marching Cubes algorithm) under the hood via the convertLabelmapToSurface
function:
Further reading:
cc @sedghi
Hello, any update on this side? I tried to follow the advices given in the previous answer myself, but didn't manage to have it working.. Thank you
What feature or change would you like to see made?
Why should we prioritize this feature?
Three-dimensional visualization of label maps can provide valuable spatial context and improved understanding of segmented structures, particularly in medical imaging applications involving complex anatomical structures or pathologies. By enabling 3D rendering of label maps as surfaces, OHIF can offer users a more intuitive and immersive experience when working with segmentation data.