Page MenuHomePhabricator

Error in Surface visualization
Closed, InvalidPublic

Assigned To
None
Authored By
lodron
Nov 24 2010, 7:17 AM
Referenced Files
F643: surface.jpg
Feb 2 2011, 4:18 PM
F642: TestSinglePolygon.vtk.txt
Nov 24 2010, 9:30 AM
F641: Test1.vtk.txt
Nov 24 2010, 7:26 AM

Description

I added an attachment with a .vtk file which displays four 2D polygons (see 3D view) in 3D space. The three 2D views should display a cut through these four polygons so there should be 4 Lines displayed in Axial/transversal/coronal (for sure only if the cutting plane is not planar to the polygons).

This only works for 3 of the 4 polygons, one polygon is not cutted through, i do not understand why. I debugged the code, i am not sure if the error lies in MITK or in the VTK cutter function

Event Timeline

Please rename it to .vtk, i am not allowed to upload .vtk files so i renamed it to .vtk.txt

It can be readen by MITK (it contains vtkPolyData)

This fix will not be included in target milestone 1.1 as it's just about to be released. I'm postponing this bug to target 1.2.

The sinlge polygon of the four which cannot be cutted

Ok

i figured out in which case the cutter does not work, and it is a bug (but not in MITK, i think it is a bug of VTK):

Working Polygon:

(0 0 0)
(10 0 0)
(10 10 0)
(0 10 0)

This Polygon is cut correct. And this is not cut correct:

(0 0 0)
(10 0 0)
(10 5 0)
(15 5 0)
(10 5 0)
(10 10 0)
(0 10 0)

You can see that in my second case the boundary has an infinite small spike. This results in an empty cutting result. In my opinion this is a valid polygon so the cutting should be calculated...

Sorry, but there IS a bug in MITK:

Please load following valid Polygon (no infinite small spike) and compare surface representation and wireframe in 3D visualization widget:

vtk DataFile Version 3.0

vtk output
ASCII
DATASET POLYDATA
POINTS 7 float
0 0 50 100 0 50 100 50 50
150 50 50 90 60 50 100 100 50
0 100 50
POLYGONS 1 8
7 0 1 2 3 4 5 6

CELL_DATA 1
SCALARS scalars double 3
LOOKUP_TABLE default
1 0 0

Hi Gerald,
it seems to be a VTK-bug:
we loaded your polygon from comment 5 into Paraview and the bug still appears (see comment 6).
We are also curious about the visualization error. If you find something out via the vtk-list, please let us know.
Thanks
Anja

Ya,

I "think" I debugged it to the EarCutTriangulation () of vtkPolygon in line 1277 success = this->EarCutTriangulation(); (returns false on such peaky polys) but i am not 100% sure. My triangulation vodoo is not quite good so i cannot exactly say where the error is ... But i already made a vtk bug report 0011504 see http://public.kitware.com/Bug/view.php?id=11504. But the response of the vtk community is quite low^^^

Anything new from VTK on that bug?

Mail from Karthik Krishnan (from kitware) on 16.2.2011

Thanks Gerald. We often need to be jolted with a stick. Thanks for the reminder. The first test dataset (TestRectangelWithSpike.vtk) is clearly degenerate. The polygon has 3 co-linear points that loop back on each other.

The second one is as you've mentioned a normal concave polygon and needs to be looked further into.

thx

karthik

so it seems that colinear points are not supported by vtk
and on the rendering problem of concave polygons i am still waiting....

Is there anything new regarding this bug? Gerald, can we close this bug?

i dont't think that vtk solved that problem, a long time ago they told me that vtk dos not define/allow polygons of that degenerated type (i also found it in the VTK doku that VTK only support "valid" polygons which always have a volume, no spikes, no crossing lines etc). They told me that i can pay them if i need this behaviour but this is nothing i want:

Mail from David E DeMarle:
"If you have a critical bug for your usage that you need to have fixed promptly consider purchasing a support contract from kitware.

The free support that Kitware and the rest of the community give generally only comes around when it happens to align well with whatever work people are being paid to do."

in the mean time i wrote my own vtkCutter which works fine on Polygons and planes (polygons only, i only have polygons in my special application), it works this way:

-> interpreting polygons as linearrays
-> delete lines which do not cut the plane (90% of all lines get usually lost)
-> cut each line with the plane -> we get point lists
-> go from left to right in the plane and search pointpairs for newly created lines (first point is begin of first line, second point end of first line, third point is begin of second line and so on)

a little bit complicated but it seems to be the only way to cut such polygons due to the fact that my polygons are painted from human users and could have such nasty structures (they are from DICOM RT struct data files form a radiotherapy system)...

As i said my filter is only designed for planar 2D polygons, nonplanar or higher dimensional structures are not neccassary for my purposes and not implemented so my filter could not 100% replace the vtkCutter...

But the 3D visualization is still implemented in VTK and lacks in visualization...

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:33 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:37 PM
kislinsk removed a project: Bulk Edit.