[vtk-developers] Problem writing out 'hollow' contours inrtstructs

Karthik Krishnan karthik.krishnan at kitware.com
Tue Dec 21 22:58:40 EST 2010


On Wed, Dec 22, 2010 at 4:34 AM, Dean Inglis <dean.inglis at camris.ca> wrote:

> Mark,
>
> here are some possible solutions to 1 for now:
>
>
> 1) the ability to determine if one polydata is entirely contained
> within another (I don't think that this is trivial, given how
> contorted these polydata can be)
>
> - a first rejection test: form bounding boxes (see vtkBoundingBox) and
> do simple range inclusion tests:
>   myvtkBoundingBox.AddBounds(myvtkPolyData.GetBounds())
>   myvtkBoundingBox.Contains( anothervtkBoundingBox )
> - triangulate the outer polygon and then do point inclusion tests
> against the resulting triangles with the inner polygon vertices
>

IMHO this step may be harder than stated for non-convex polygons. Last I
checked (few years ago) constrained triangulation using vtkDelaunay2D
produced an output with holes.

Alternatively vtkPolygon::PointInPolygon test for each of the inner vertices
against the outer polygon should work, although it would be slower.

Thanks
--
karthik

- perform edge intersection tests
>
> the last two options could be made somewhat efficient if you
> make use of appropriate vtkLocator subclasses.
>
>
> Dean
>
> ----- Original Message ----- From: "Mark Roden" <mmroden at gmail.com>
> To: "Dean Inglis" <dean.inglis at camris.ca>
> Cc: <vtk-developers at vtk.org>
> Sent: Tuesday, December 21, 2010 11:29 AM
> Subject: Re: [vtk-developers] Problem writing out 'hollow' contours
> inrtstructs
>
>
>
> Hi Dean,
>
> Yes, this is it exactly, and how Eclipse handles this case.  As to how
> they do it, as far as I know, their source is not opened.
>
> One possible solution is to identify those two polygons and look for
> the 'leftmost' or 'topmost' points in each (ie, the point with the
> lowest x value or the lowest y value), but that assumes that the two
> polygons have been sampled identically-- if one were drawn such that
> the underlying points were spaced 10 pixels apart, and the other 2,
> then the 'leftmost' or 'topmost' might not line up.  If there were a
> way to arbitrarily resample a polydata to ensure single-pixel spacing,
> then that sampling issue would be solved.
>
> Another possible problem is folds in the outer polygon.  If the outer
> polygon has a 'ripple' near the leftmost/topmost point, then the
> keyhole shouldn't be opened with the leftmost point in the polygon,
> but with the closest point.
>
> So, with that in mind, I'd need two functions:
> 1) the ability to determine if one polydata is entirely contained
> within another (I don't think that this is trivial, given how
> contorted these polydata can be)
> 2) Joining two polydata with a keyhole, using the 'topmost' point of
> the inner polydata to the closest point on the outer polydata
>
> Thanks,
> Mark
>
> On Mon, Dec 20, 2010 at 5:34 PM, Dean Inglis <dean.inglis at camris.ca>
> wrote:
>
>> Hi Mark,
>>
>> I think if you have a donut for example, and want
>> to encode it you would have to form the donut
>> by bringing the free ends of a "C" arbitrarily close
>> together so that you really only have one vtkPolyData
>> object. I think if this example of a rectangle with a hole
>> reproduces correctly in the list archive, you'll see what I
>> mean:
>>
>> 0----------1
>> | 5---4 |
>> | | | |
>> | | 3---2
>> | | 8---9
>> | | | |
>> | 6---7 |
>> 11---------10
>>
>>
>> points 3, 8 and 2, 9 are coincident and form the keyhole.
>> I this how Eclipse accomplishes this? The problem still
>> remains how to cut arbitrary polydata automatically:
>> maybe by finding the inner polygon centroid and
>> emanating a radial outward?
>>
>> Dean
>>
>> ----- Original Message ----- From: "Mark Roden" <mmroden at gmail.com>
>> To: <vtk-developers at vtk.org>
>> Sent: Monday, December 20, 2010 7:25 PM
>> Subject: [vtk-developers] Problem writing out 'hollow' contours in
>> rtstructs
>>
>>
>> Hi all,
>>
>> I've got a problem writing out RTStruct objects using GDCM. The
>> problem isn't with GDCM or VTK as they stand now, but rather with a
>> particular section of the DICOM standard (3.3-2009 C 8.8.6.3). The
>> problem has to do with a 'hollow' contour, or a polygon entirely
>> encompassed within another polygon.
>>
>> To quote:
>> When a single ROI describes an excluded inner volume, this can be
>> encoded with a single contour, using a “keyhole” technique. In this
>> method, an arbitrarily narrow channel is used to connect the outer
>> contour to the inner contour, so that it is drawn as a single contour.
>> An example of such a structure is shown in Figure C.8.8.6-1.
>>
>> If I have a set of vtkPolyData objects on a particular plane, is there
>> an easy way to accomplish the above functionality?
>>
>> As I understand it, vtkPolyData are (or can be) oriented glyphs that
>> indicate how a polygon should be drawn. If I were to just connect any
>> two polydata objects, I'd imagine that would would need to be
>> reversed. Is that understanding correct?
>>
>> Or if I made a binary representation of the mask that had a hollow in
>> it, is there a way to indicate to the marching cubes to use the
>> keyhole to join the inner and outer polygons?
>>
>> Part of the problem of this keyhole technique is the use of the words
>> 'can be encoded'-- so while it's possible that other schemes could be
>> used, this scheme is the only one suggested by the standard and is the
>> one supported by Eclipse (and as far as I know, Eclipse's
>> implementation is the one to match at the moment).
>>
>> Thanks,
>> Mark
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
>>  _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20101222/70e0ee5a/attachment.html>


More information about the vtk-developers mailing list