I’m using a thin slab volume actor (using clipping planes) along with multiple polydata actors (each with unique color and the same clipping planes applied) to render a DICOM RT, and it works fine, but not performance wise.
Yes, you can “append” all your polydata in a unique polydata (vtkAppendPolyData). Then you can create a “point data” scalar array of unsigned ints and assign a unique value per original “polydata” (I think it would be a great optional behavior to add to vtkAppendPolyData). You can then use a vtkLookupTable or a discretized vtkColorTransferFunction to assign a unique color to each point (see example).
Thanks for the reply Julien.
Basically my second question is that is there any alternative to vtkClipClosedSurface which is a filter for clipping closed surfaces BUT for polyData? Is there such filter to clip polyData in CPU via a filter? (I guess it accepts two planes and just remove the vertices that the polyData has outside those planes)
They are 3D contours and not volumes, since they are overlapping and they span whole image (often +100 slices), I guess the cost of having 31 volumes in the cache would be huge, unless I’m missing something
I tried the clipClosedSurface and vtkCutter and it was not great re performance. So I used the AppendPolyData and it works like a charm for the performance, I can reach 58 fps which is awesome
(video below if you are intereseted)
before I move to figuring out the coloring for each contour, I had a question about using AppendPolyData
is it possible to have separate thickness assigned for each polyData?
I appreciate your help along the way Julien. I was able to fully implement the appendPolyData. Something interesting that I encountered was that the lineWidth had a direct impact on the rendering performance (fps). Is this a known fact? See below comparison of lineWidth 10 (achieving 20 fps) vs lineWidth of 1 (58 fps)
@Alireza Yes, line width is tricky. Most of the graphics drivers support very small widths, so the mapper simulates wide lines by instancing the original line. If you want, you can query the maximum supported line width via openglRenderWindow.getHardwareMaximumLineWidth() and stick to a width under that number. However, the lines will look different on different systems.