dosimetry:userguide:thinknode
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dosimetry:userguide:thinknode [2015/09/25 13:05] – [dosimetry_worker] dpatenaude | dosimetry:userguide:thinknode [2021/07/29 18:23] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
====== Python ====== | ====== Python ====== | ||
+ | Please refer to the [[https:// | ||
===== Python: Overview ===== | ===== Python: Overview ===== | ||
Line 152: | Line 153: | ||
# Get IAM ids | # Get IAM ids | ||
iam = thinknode.authenticate(thinknode.read_config(' | iam = thinknode.authenticate(thinknode.read_config(' | ||
- | |||
- | def make_grid(corner, | ||
- | ... | ||
- | |||
- | def make_water_phantom(corner, | ||
- | return \ | ||
- | thinknode.function(" | ||
- | [ | ||
- | make_grid(corner, | ||
- | thinknode.value(1), | ||
- | thinknode.value(" | ||
- | ]) | ||
def make_dose_points(pointCount): | def make_dose_points(pointCount): | ||
Line 213: | Line 202: | ||
thinknode.function(" | thinknode.function(" | ||
[ | [ | ||
- | | + | |
thinknode.value(make_dose_points(181)), | thinknode.value(make_dose_points(181)), | ||
beam_geometry, | beam_geometry, | ||
- | make_grid([-75, | + | |
make_layers(2270.0, | make_layers(2270.0, | ||
compute_aperture(), | compute_aperture(), | ||
Line 230: | Line 219: | ||
==== rt_types ==== | ==== rt_types ==== | ||
- | The // | + | The // |
Each data type detailed in the [[http:// | Each data type detailed in the [[http:// | ||
- | Below you will see as snippet from the rt_types module that shows the class for the //polyset// rt_type along with its default | + | Below you will see a snippet from the rt_types module that shows the class for the //polyset// rt_type along with its default |
<code python> | <code python> | ||
Line 283: | Line 272: | ||
</ | </ | ||
- | * **Interdependence: | + | * **Interdependence: |
- | * **// | + | * **// |
- | * **// | + | * **// |
- | Below is an example usage of getting a thinknode dose image (image_3d data type in the astroid manifest) and turning it into a rt_types image_3d data type, then using that data type to output the image as a VTK graphics file: | + | Below is an example usage of getting a thinknode dose image (image_3d data type in the astroid manifest) and turning it into a rt_types image_3d data type, so that it can be expanded and then used to output the image into a VTK graphics file: |
<code python> | <code python> | ||
Line 303: | Line 292: | ||
The // | The // | ||
- | Refer to the [[https:// | + | Refer to the [[https:// |
<code python> | <code python> | ||
Line 341: | Line 330: | ||
==== dosimetry_worker ==== | ==== dosimetry_worker ==== | ||
- | The dosimetry_worker module provides | + | The dosimetry_worker module provides |
Refer to the [[https:// | Refer to the [[https:// | ||
Line 353: | Line 342: | ||
==== vtk_worker ==== | ==== vtk_worker ==== | ||
- | The VTK worker provides a means to write out common rt_types to a .vtk file format that can be visualized in [[http:// | + | The VTK worker provides a means to write out common rt_types to a vtk file format |
- | Below is an example of turning a dose image_3d into a .vtk file for visualization in Paraview: | + | Below is an example of turning a dose image_3d into a vtk file for visualization in Paraview: |
<code python> | <code python> | ||
Line 370: | Line 359: | ||
==== decimal_logging ==== | ==== decimal_logging ==== | ||
- | The // | + | The // |
The following settings are available in the decimal_logging.py file: | The following settings are available in the decimal_logging.py file: | ||
Line 376: | Line 365: | ||
**display_types: | **display_types: | ||
**log_file: ** sets the logfile name and location | **log_file: ** sets the logfile name and location | ||
+ | |||
+ | === Debugging === | ||
+ | |||
+ | When debugging, use the dl.debug() function and set the //isDebug// flag in the decimal_logging library to True. This toggles on the output for each of the dl.debug calls. By default we keep debugging off, but it can be turned on as needed. | ||
+ | |||
+ | === Other Flags === | ||
+ | |||
The following image shows the logging settings for each message type as: | The following image shows the logging settings for each message type as: | ||
Line 384: | Line 380: | ||
{{ dosimetry: | {{ dosimetry: | ||
- | === === | + | === File Logging |
+ | |||
+ | The decimal_logging library also provides simple file logging. The // | ||
+ | |||
+ | * log(message) | ||
+ | * log_debug_data(message, | ||
+ | * log_data(data) | ||
---- | ---- |
dosimetry/userguide/thinknode.1443186308.txt.gz · Last modified: 2021/07/29 18:21 (external edit)