User Tools

Site Tools


dosimetry:userguide:design_task_functions:dtf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dosimetry:userguide:design_task_functions:dtf [2015/08/07 20:36] – [Geometry] dpatenaudedosimetry:userguide:design_task_functions:dtf [2021/07/29 18:28] (current) – external edit 127.0.0.1
Line 9: Line 9:
     * Compute the aperture without smoothing.     * Compute the aperture without smoothing.
     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.
-  * **compute_smooth_aperture:** +  * **compute_smoothed_aperture:** 
-    * Compute an aperture smoothed with a Guassian type blur on all targets and organs+    * Compute an aperture smoothed with a vertex shift on all targets and organs
     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.
   * **smooth_aperture:**   * **smooth_aperture:**
-    * Smooth an existing aperture with a Gaussian type blur.+    * Smooth an existing aperture with a vertex shift.
   * **get_field_rect:**   * **get_field_rect:**
     * Gets the bounding box (in BEV) for the aperture opening (at true size not projected).     * Gets the bounding box (in BEV) for the aperture opening (at true size not projected).
Line 23: Line 23:
     * Builds an aperture using the given point list.     * Builds an aperture using the given point list.
     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.     * Recommended mill radius value is is 4.7625mm (0.1875") and advised to be no less than 2.38125mm (0.09375") to allow for accurate machining.
 +  * **remove_polyset_holes:**
 +    * A polyset's holes defined an aperture's floating islands. By removing the polyset holes, the resulting computed aperture will contain no islands.
 +    * This function removes the holes from a polyset of an existing aperture (e.g.: Call compute_aperture() and using the polyset from the returned aperture call remove_polyset_holes(). Then replace the original aperture polyset with the polyset returned from remove_polyset_holes())
 +  * **apply_mill_radius:**
 +    * This function applies a machinability enforcement using a tool mill radius to a polyset of an existing aperture. The resulting polyset shape will not have corners that produce machined under cutting for the mill radius defined.
 ==== Geometry ==== ==== Geometry ====
  
Line 38: Line 43:
 ==== Computing an Aperture Shape ==== ==== Computing an Aperture Shape ====
  
-This example will provide a high level walk through of calling the //compute_smooth_aperture// function (note //compute_aperture// is simply a reduced version of this function so this example applies equally to both functions). The code here is meant to be used as a guide on the process to follow and functions/data types to construct. The returned value is the computed geometric shape of the aperture (projected to the given downstream position) based on the arguments passed into the calculation request.+This example will provide a high level walk through of calling the //compute_smoothed_aperture// function (note //compute_aperture// is simply a reduced version of this function so this example applies equally to both functions). The code here is meant to be used as a guide on the process to follow and functions/data types to construct. The returned value is the computed geometric shape of the aperture (projected to the given downstream position) based on the arguments passed into the calculation request.
  
   - Construct a //beam_geometry//   - Construct a //beam_geometry//
Line 66: Line 71:
   - The //aperture_creation_params// are then sent to the dosimetry app as calculation requests following [[dosimetry:userguide:thinknode|thinknode™ calculation request]] examples.   - The //aperture_creation_params// are then sent to the dosimetry app as calculation requests following [[dosimetry:userguide:thinknode|thinknode™ calculation request]] examples.
     - <code cpp>     - <code cpp>
-// Compute the aperture shape. Parameters are: aperture_creation_params, smoothWeightFactorsmoothSizeFactor +// Compute the aperture shape. Parameters are: aperture_creation_params, smoothSizeiter, beam_geometry 
-aperture aper = compute_smoothed_aperture(ap_params, 10., 2.1);+aperture aper = compute_smoothed_aperture(ap_params, 1., 5, geometry);
 </code> </code>
  
Line 124: Line 129:
 Enforcing machinability of the apertures at all evaluation steps is required in order to achieve plan vs. actual. Determining the machinable aperture shape is accomplished by performing an offset of the current “unmachinable” aperture shape by the radius of the final milling tool (in either the inward or outward direction) and then re-offsetting this result by the same distance. Machinability is enforced during aperture computation by using the //mill_radius// parameter of the //aperture_creation_params// Enforcing machinability of the apertures at all evaluation steps is required in order to achieve plan vs. actual. Determining the machinable aperture shape is accomplished by performing an offset of the current “unmachinable” aperture shape by the radius of the final milling tool (in either the inward or outward direction) and then re-offsetting this result by the same distance. Machinability is enforced during aperture computation by using the //mill_radius// parameter of the //aperture_creation_params//
  
-Additionally, smoothing can also be explicitly used to further simplify the aperture shape. +Additionally, smoothing can also be explicitly used to further simplify the aperture shape. As shown in <imgref ap_smoothalgorithm> below, a line segment (Line1) is created using the center points of the two edges that touch the vertex. A second line segment (Line2) is created going from the vertex to the center point of Line1. The vertex will be shifted along Line2 according the the //smoothSize// parameter of the //compute_smoothed_aperture// function. The value of //smoothSize// should be set between 0.0 and 1.0, indicating how far along Line2 the vertex will shift (0.5 will shift it to the center of Line2, and 1.0 will shift it to the intersection of Line1 and Line2). The //iter// parameter will indicate how many times the smoothing algorithm will act on the given aperture, with higher values resulting in more smoothing.
  
 The images below provide an exaggerated visual explanation of the creation options for aperture smoothing and mill radius.  The images below provide an exaggerated visual explanation of the creation options for aperture smoothing and mill radius. 
   - <imgref ap_beam_setup>: shows the beam setup of the example aperture   - <imgref ap_beam_setup>: shows the beam setup of the example aperture
 +  - <imgref ap_smoothalgorithm>: shows an example diagram of the smoothing algorithm. 
   - <imgref ap_noradiusnosmooth>: shows a resulting aperture shape with no mill radius and no smoothing applied to the aperture creation parameters    - <imgref ap_noradiusnosmooth>: shows a resulting aperture shape with no mill radius and no smoothing applied to the aperture creation parameters 
-    * Note: Recommended mill raiud value is is 2.3815mm (0.09375") and advised to be no less than 0.79375mm (0.03125") to allow for accurate machining.+    * Note: Recommended mill radius value is is 2.3815mm (0.09375") and advised to be no less than 0.79375mm (0.03125") to allow for accurate machining.
   - <imgref ap_radiusnosmooth>: shows a resulting aperture shape (black) with a large mill radius applied but not utilizing smoothing options in the compute aperture process.   - <imgref ap_radiusnosmooth>: shows a resulting aperture shape (black) with a large mill radius applied but not utilizing smoothing options in the compute aperture process.
-  - <imgref ap_radiussmooth>: shows a resulting aperture shape with a large mill radius applied to the aperture creation parameters and smoothing options using the //compute_smooth_aperture// function.+  - <imgref ap_radiussmooth>: shows a resulting aperture shape with a large mill radius applied to the aperture creation parameters and smoothing options using the //compute_smoothed_aperture// function.
  
 +
 +<WRAP center 50%>
 <imgcaption ap_beam_setup|Source (Red), Beam (Green), Aperture Plane (Gold), and Target (Blue)>{{ dosimetry:userguide:design_task_functions:aperture_beam_setup.png?nolink&450 |}}</imgcaption> <imgcaption ap_beam_setup|Source (Red), Beam (Green), Aperture Plane (Gold), and Target (Blue)>{{ dosimetry:userguide:design_task_functions:aperture_beam_setup.png?nolink&450 |}}</imgcaption>
 +<imgcaption ap_smoothalgorithm|Method of smoothing>{{dosimetry:userguide:design_task_functions:new_smoothing.png?nolink&500|}}</imgcaption>
 +</WRAP>
  
 <WRAP center 85%> <WRAP center 85%>
-<imgcaption ap_noradiusnosmooth|Aperture no mill radius or smoothing>{{dosimetry:userguide:design_task_functions:aperture_no_smooth_radius.png?nolink&250|}}</imgcaption> +<imgcaption ap_noradiusnosmooth|Aperture no mill radius or smoothing>{{dosimetry:userguide:design_task_functions:aperture_original.png?nolink&250|}}</imgcaption> 
-<imgcaption ap_radiusnosmooth|Aperture with a mill radius, no smoothing>{{dosimetry:userguide:design_task_functions:aperture_no_smoothing.png?nolink&250|}}</imgcaption> +<imgcaption ap_radiusnosmooth|Aperture with a mill radius, no smoothing>{{dosimetry:userguide:design_task_functions:aperture_mill_radius.png?nolink&250|}}</imgcaption> 
-<imgcaption ap_radiussmooth|Aperture with mill radius and smoothing>{{dosimetry:userguide:design_task_functions:aperture_smoothing_radius.png?nolink&250|}}</imgcaption>+<imgcaption ap_radiussmooth|Aperture with mill radius and smoothing>{{dosimetry:userguide:design_task_functions:aperture_smooth.png?nolink&250|}}</imgcaption>
 </WRAP> </WRAP>
- 
 ==== Aperture Shape Manipulation ==== ==== Aperture Shape Manipulation ====
  
Line 160: Line 169:
 ap_params.overrides.push_back(aperture_manual_override(make_polyset(poly), true)); ap_params.overrides.push_back(aperture_manual_override(make_polyset(poly), true));
 ap_params.half_planes.push_back(aperture_half_plane(make_vector(0., 0.), 45.)); ap_params.half_planes.push_back(aperture_half_plane(make_vector(0., 0.), 45.));
-aperture aper = compute_smoothed_aperture(ap_params, 10., 2.1);+aperture aper = compute_smoothed_aperture(ap_params, 1., 5, geometry);
 </code> </code>
 === Structure Centerline === === Structure Centerline ===
dosimetry/userguide/design_task_functions/dtf.1438979790.txt.gz · Last modified: (external edit)