# Contour target area for MLC leaf positioning calculation

**URL:** <https://discourse.slicer.org/t/contour-target-area-for-mlc-leaf-positioning-calculation/10101>\
**Category:** Development\
**Tags:** slicerrt\
**Created:** [February 4, 2020, 11:43am UTC](https://discourse.slicer.org/t/contour-target-area-for-mlc-leaf-positioning-calculation/10101 "2020-02-04T11:43:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 4, 2020, 11:43am UTC](https://discourse.slicer.org/t/contour-target-area-for-mlc-leaf-positioning-calculation/10101/1 "2020-02-04T11:43:42Z")

</div>

Operating system: linux  
Slicer version: Preview

There are 2 points which define a normal vector 0N (yellow) of the plane (green) for DICOM CT and RTSTRUCT contour data. I can calculate a perpendicular projection of each point of target contour (red) into the plane.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/3/23923b3995e99674dcddbbec08558df3e9e07616.png)

Another task is to get only external points of projected data for perimeter and area calculation (picture below). The projection plane basically an isocenter plane.

Is there ready made vtk filter or algorithm for that purpose?

For example:

1. Input - list of points coordinates on the plane (x1, y1) (x2, y2) … (xn, yn)
2. Output - vtkPolyData closed planar polygon of the perimeter, or something like that

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/7/17dca5d33f7598ac98e9014febf0e3e9e6b5bf8b.png)

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 19, 2020, 8:56am UTC](https://discourse.slicer.org/t/contour-target-area-for-mlc-leaf-positioning-calculation/10101/2 "2020-02-19T08:56:55Z")

</div>

After some digging through the VTK examples site, i have found a [solution](https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PointsProjectedHull/) for that issue. vtkPointsProjectedHull allows to calculate convex hull of the points.
