VTK Contouring, combining perpendicular polygons

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK Contouring, combining perpendicular polygons

HarryG
Hi all,

I’m new to VTK, am trying to add contouring tools to an in-house radiation
oncology treatment planning system. I have been successful in adding the
ability to contour on axial slices (z planes), turning my drawn polygons
into masks with vtkLinearExtrusionFilter and then vtkPolyDataToImageStencil,
but can't figure out how contours from perpendicular axes should be
combined.

The user should be able to contour on all three planes simultaneously with
any drawn polygon being immediately incorporated into the overall structure.
I can create polygons like on the axial plane, but can’t figure out how
these perpendicular polygons should be integrated. My thinking is that I
need to get a list of all voxels within the polygons on these perpendicular
planes, and then add all the voxels from all the planes and recreate a
contour from this list – is that even a correct assumption?

There seem to be quite a few posts dealing with the concept of creating 3D
surfaces from 2D contours, but none that I could find on combining contours
from multiple planes. Is there something obvious I am missing?

Thank you,
Harry



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK Contouring, combining perpendicular polygons

HarryG
Hi ,
I’m writing a follow-up to my previous post:

I have been mostly successful in combining stencil data from the three axes,
simply using vtkImageStencilData -> Add().

My problem now is that the contours on the X and Y axes behave very
strangely with my mask generation pathway (stacked polylines ->
vtkLinearExtrusionFilter -> vtkPolyDataToImageStencil -> vtkImageStencil
combined with blank mask), while on the z-slices it seems to work perfectly.

I gather from the documentation this has something to do with the following
warning in vtkPolyDataToImageStencil: “If contours are provided, the
contours must be aligned with the Z planes. Other contour orientations are
not supported.”.

Is there some way to get around this? In my mind any algorithm that works on
the axial slices should work on the other slices, and I don’t understand why
this isn’t the case. I’ve been trying to rotate the X and Y contours so they
line up along the Z axis, but am stuck when trying to rotate the stencil
back to the proper orientation to be combined with the others.

Any advice would be greatly appreciated,
Harry



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK Contouring, combining perpendicular polygons

HarryG
I have implemented a feasible but probably suboptimal solution:
I ended up flipping the axes of the sagittal and coronal plane contours to
give them constant Z values, then I extruded and stenciled that flipped
data, then I was able to manually flip the axes of the stencil back to the
original orientation to be merged with the other axes.

This whole process has felt pretty ridiculous, so I would love to hear if
there is an easier way to do it, but this way works for now.
Feel free to email if you have any questions on the details of my solution,
and I can post the actual code here when it becomes open source in the
coming months.

Thanks,
Harry



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK Contouring, combining perpendicular polygons

Andras Lasso
> This whole process has felt pretty ridiculous

Have a look at the source code and you'll see how the filter works and understand its limitations. Any contributions for improving the filter are welcome.

VTK discussions have moved to https://discourse.vtk.org/. Please post further questions and comments there.

Andras

-----Original Message-----
From: vtkusers <[hidden email]> On Behalf Of HarryG
Sent: Tuesday, February 12, 2019 4:29 PM
To: [hidden email]
Subject: Re: [vtkusers] VTK Contouring, combining perpendicular polygons

I have implemented a feasible but probably suboptimal solution:
I ended up flipping the axes of the sagittal and coronal plane contours to give them constant Z values, then I extruded and stenciled that flipped data, then I was able to manually flip the axes of the stencil back to the original orientation to be merged with the other axes.

This whole process has felt pretty ridiculous, so I would love to hear if there is an easier way to do it, but this way works for now.
Feel free to email if you have any questions on the details of my solution, and I can post the actual code here when it becomes open source in the coming months.

Thanks,
Harry



--
Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155393657&amp;sdata=iQtwsqXIb31NBQN8FTgPmnmDSM906xP%2BBjz%2FCw6RuYA%3D&amp;reserved=0
_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155393657&amp;sdata=qXdRJoV3by2mQkeeKerzzTPKgqmatKAV7bgSWBJNEZY%3D&amp;reserved=0

Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155393657&amp;sdata=PprwIEZSRdQTX6tPCKWOuBw8Qre2KRYbqd1W1NfJxh8%3D&amp;reserved=0

Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155403666&amp;sdata=XcwrvsgZJj35L3ehlzNV6E%2B2otL5mpIBULuowY03CEI%3D&amp;reserved=0

Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155403666&amp;sdata=JtDYf69woX4ddw2Sn9ilCmr9SN8V%2Fqn5m7LoNKCBxYs%3D&amp;reserved=0

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&amp;data=02%7C01%7Classo%40queensu.ca%7Ca1b9d6968ef5445f0f0e08d691318215%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C1%7C636856039155403666&amp;sdata=J5jjOl5gFDAfxp1TPVtche2F2J6sWAfHQCb7l6kOCJg%3D&amp;reserved=0
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers