New Isocontouring filter for discrete, labled volumetric data: vtkSurfaceNets3D

Decimation or remeshing is definitely needed as part of a region extraction workflow. In VTK we try to break these up into separate filters / classes so they can be more easily reused and combined into other workflows.

What I could see happening is a very specialized decimation algorithm that operates on “patches” (patches being the area of contact between two regions). The patches are bounded by a complex network of edges along which the patches join (sort of like the curves at which soap bubbles touch each other). Within each patch the adjacency 2-tuple remains unchanged so cell data would be preserved. To preserve compatibility, the decimation would have to reduce the patch edges and carry these changes into the connected patches etc. It would be fun to do, but tricky :slight_smile:

And if you are a glutton for punishment, I pushed a draft MR with a method to extract a region given its label. The method is:

void ExtractRegion(vtkIdType labelId, vtkPolyData *regionData,
bool boundaryFaces=false, bool cleanPoints=false);

(Note that the cleanPoints boolean has no effect yet, it is a placeholder for this ongoing work.) There is also a test TestSurfaceNets3D4.py which show how it works.

Running this extraction, I learned a lot. I am clearly seeing the effects of different regions in contact with another - I’m not happy with what I am seeing in some cases. (This shows up after smoothing is enabled, the contact patch edges shows up clearly.) I am pretty sure that the smoothing can be improved and I’ll work on it. In the mean time, it’s possible to extract the unsmoothed SurfaceNet regions (set smoothing iterations=0, or smoothing off) and then use a separate filter like vtkWindowedSincPolyDataFilter or vtkConstrainedSmoothingFilter to produce results.

Here’s the difference. When you smooth the SurfaceNet all together, the regions in contact with one another exert smoothing forces that cause slight “ridges” where the region edges join. The good news is that points and triangles are shared across boundaries. On the other hand, when you “extract” a region, and then smooth it, the region is decoupled from the SurfaceNet and you don’t see the effects of adjacent regions on the regions surface. The bad news is that the objects may not longer touch (after smoothing) and points and triangles are no longer shared. I’m reworking the API so that both workflows are possible. Also threading this stuff so the extraction process is as fast as the basic SurfaceNets algorithm.

Hopefully this makes some sense :slight_smile:

2 Likes