Skin dose map field sizes incorrect when exposure has a non-zero secondary angle

Issue #933 resolved
David Platten created an issue

When an exposure has a non-zero secondary angle (caudo-cranial) the size and shape of the field at the skin surface is incorrectly calculated. This has been discussed with @Jonathan Cole who has proposed a fix where line 112 in geomfunc.py is changed from:

yvector = np.array([0, np.sin(a_ray.yangle), np.cos(a_ray.yangle)])

to:

yvector = np.array([0, np.sin(a_ray.yangle), -np.cos(a_ray.yangle)])

Comments (34)

  1. David Platten reporter

    Implementing fix suggested by JACole to address bug that caused incorrect field size for exposures with non-zero secondary angle. Changed openSkin version from 0.80 to 0.81 to force skin dose maps to update themselves. Refs issue #933

    → <<cset e1b135da3f04>>

  2. David Platten reporter

    Improved calculation of skin area exposed. This now calculates the area of the skin exposed, rather than the size of the field at the skin surface normal to the x-ray source to isocentre direction. It therefore now accounts for any curved phantom surfaces and changes in the field size at the phantom surface due to non-zero secondary angles. Note that this will only work correctly once the error affecting field size for non-zero secondary angles is also fixed. Refs issue #935 and issue #933

    → <<cset 86053fe343a4>>

  3. David Platten reporter

    Replacing use of np.arctan with np.arctan2 as this removes the need to check for a divide by zero issue and also respects the sign of the two parameters. This removes the need to add a minus sign to the yvector calculation in the collimate function. Refs issue #933

    → <<cset 01eec691a052>>

  4. David Platten reporter

    Correcting openSkin code to address cc angle bug using Jon Cole's openSkin repository changes. Also made default table width 45 cm rather than 40 cm to match my clinical Siemens Artis zee systems [we should implement a feature where an admin user can define the width of the table for openSkin calculations]. Refs issue #933

    → <<cset d66304ca9e45>>

  5. David Platten reporter

    Removing the backscatter fix from this branch because it is already included in the 935 branch. Once the 935 branch is merged in to develop I will sync this 933 branch to bring them together. Refs issue #933 and issue #935

    → <<cset f974e9743e5e>>

  6. David Platten reporter

    Replacing use of built in python round function with a custom method because the in-built one (and Numpy's) both use Banker's Rounding, which does not follow the mathematical convention. The difference in rounding affects the calculation of points around the surface of the 3d openSkin phantom. Refs issue #946 (and sort-of references issue #933). Ed: apologies if you don't like that I've committed this into the 933 branch rather than creating a branch of its own.

    → <<cset c54bf2ec3f88>>

  7. David Platten reporter

    Changed round_properly to a function and reordered imports (following Codacy comments). Removed print statements and exit() command. Added int() around the elements of a numpy.zeros statement to avoid an error. Refs issue #946 (and sort of references issue #933)

    → <<cset 32e1bbc9a901>>

  8. David Platten reporter

    Updated skin dose map code to incorporate openSkin modifications to ensure correct size and shape of field at the phantom surface. Also ensuring each skin dose cell is 1x1 cm. I suspect there will need to be further work on this because of the head that is included in the OpenREM code that is not present in the openSkin code. Specifically, the method skin_map in the file skinmap.py uses the previous cell location to work out if there has been a hit. This is likely to cause an issue when the current cell is in the head, and the previous cell is in the body. May need to have code that is 'if in body' and another which is 'if in head'. Refs issue #933 and issue #948

    → <<cset 9dbd94017b77>>

  9. David Platten reporter

    Added a pickle file to the test results containing skin map data for the RF-RDSR-Siemens-Zee.dcm study calculated using the latest openSkin code. Modified make_skin_map.py so it can be used to return skin dose map data to the calling routine so that can be used in test files. Updated the openskin test file to compare the reference skin dose map data in the pickle file with that calculated from the study. Also updated JavaScript to ensure only one decimal place displayed for phantom height, width and depth. I will carry out a Monte Carlo simulation of this study so we have an independent reference for the peak skin dose (although this will not include the phantom head). Refs issue #811, #933 and #948.

    → <<cset 2046efaf7feb>>

  10. David Platten reporter

    Forcing 3D skin dose map object to use nearest neighbour when stretching data to fit the model. This prevents interpolation, and results in the 3D skin dose map points looking the same as the 2D map, rather than the blurry version we have at the moment. Sort-of refs issue #933

    → <<cset 97d6a121d18c>>

  11. David Platten reporter

    Updating warning message below skin dose maps to reflect the fact that validation has been carried out on the body section of the phantom for a Siemens Artis zee system. Also put the 'Summary of studies' in a list item and removed the table-indent css so that the table does not overlap with the skin dose map. Refs issue #933

    → <<cset aa403545341e>>

  12. David Platten reporter

    Updating warning message to inform users that the skin dose values depend on the accuracy of the x-ray system dose and reference point and DAP values. Refs issue #933

    → <<cset 3ab6c6a79472>>

  13. Log in to comment