[vtkusers] code within VTK to construct faces of 3D cells (e.g. for rendering)
Dr. Roman Grothausmann
grothausmann.roman at mh-hannover.de
Fri May 9 11:23:26 EDT 2014
Dear mailing list members,
In order to create a vtkExtractFaces-filter (to realize my approach described
below) I wonder if there already exists some code in VTK that
calculates/generates faces when actually rendering 3D cells, e.g. a VTK_VOXEL.
Doesn't OpenGL or the graphics-card need faces for rendering?
However, searching through the code of VTK-6.1 I wasn't able to find such code
pieces. Is that done outside VTK or not needed at all?
I once noticed that a non-planar vtkPolygon consisting of 4 vertices (i.e. a
quad) not all contained within a single plain can be rendered in e.g. Paraview.
However when I ran vtkTriangleFilter on that quad the result divided the quad in
two triangles in the opposite way than the direct renderer of the quad.
From that I'd guess there exists some code for rendering that does the
triangulation in a different way.
Any help or hints are very much appreciated
Roman
On 28/04/14 13:51, Dr. Roman Grothausmann wrote:
> Dear mailing list members,
>
>
> I'd like to calculate the Euler Characteristic
> (http://en.wikipedia.org/wiki/Euler_characteristic) of "filled" objects
> (represented in binary 3D images).
> Using vtkThreshold I get a vtkUnstructuredGrid containing vtkPoints and vtkCells
> of type VTK_Voxel.
>
> To calculate the Euler Characteristic Xi of the "unfilled" objects I'd do:
> xiu= numPoints - numEdges + numFaces;
> (all values based on the output of vtkGeometryFilter for with numFaces==number
> of 2D cells)
>
> (e.g. xiu for a unfilled Cube/Voxel:
> 8 verts - 12 edges + 6 faces
> = 2 == 1 connected_Component - 0 handles + 1 cavity)
>
>
> To calculate the Euler Characteristic Xi of the "unfilled" objects I'd do:
> xif= numPoints - numEdges + numFaces - numVoxel;
> (all values based on the output of vtkThreshold directly)
>
> (e.g. xif for a filled Cube/Voxel:
> 8 verts - 12 edges + 6 faces - 1 volumeElement
> = 1 == 1 connected_Component - 0 handles + 0 cavity)
>
>
> Getting the number of Edges is easily done with vtkExtractEdges but how can I
> get the number of Faces if no face-cells exist in the output of vtkThreshold?
> Is there kind of vtkExtractFaces, which (unlike vtkGeometryFilter) extracts also
> the faces of 3D-cells fully contained in the inside of the vtkUnstructuredGrid?
> Do I have to create the 6 faces for each VTK_Voxel manually?
> And if so, how can I prevent the creation of duplicate faces or merge these in a
> second step?
> Or is there a far easier way to calculate the Euler Characteristic of "filled"
> objects represented in binary 3D images?
>
> In another try I used ITK with itkQuadEdgeMesh, which does support Orientations
> but seemingly no 3D cells, so I guess it won't be easy to get the number of
> volume elements there for the calculation of xif.
>
> Any help or hints are very much appreciated
> Roman
>
>
>
--
Dr. Roman Grothausmann
Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis
Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover
Tel. +49 511 532-9574
More information about the vtkusers
mailing list