Check for existing skin dose map data sometimes fails

Issue #631 resolved
David Platten created an issue

This is due to an insufficient check on whether the patient height or mass has changed. See commit to follow shortly.

This bug results in a completely blank skin dose map area when revisiting a study where the skin dose map could not be calculated. In this situation the user should be shown some text telling them that the calculation did not work.

Comments (10)

  1. David Platten reporter

    This fix is in-place on my live 0.8.0b6 system and works as expected. Studies that used to show a blank now display the text saying that the skin dose map could not be calculated.

  2. David Platten reporter

    The bug that this fixes was caused when a fluoroscopy study is imported into OpenREM with a zero value for either patient mass or height.

    Initial skin dose calculation:

    • if a patient has an empty or zero patient height or mass then sensible defaults are used when the skin dose map is calculated

    • these height and mass values are stored in the skin dose map pickle file

    • skin dose map is then calculated. If it fails user is shown some friendly text

    On subsequent views of the same study:

    • reads in the existing pickle file for the study

    • patient mass and height are extracted from the database

    • pickle file and database height and mass are compared; if they're different then the skin dose map is recalculated

    This is the bug: for a zero height or mass stored in the database the comparison will always cause the skin dose map to be recalculated. This recalculation then runs into a permission error because the code doesn't allow the existing pickle file to be overwritten.

    The fix is to check for a zero height or weight, and if found set the value to the corresponding default.

  3. Ed McDonagh

    Looks like a good fix. I've made a minor coding style change - can you update your version with it just in case please?

  4. David Platten reporter

    My live system is now updated with the style-change code. It works as expected on repeat viewings of exiting studies, but I need to wait for some new Toshiba or Philips fluoro studies to come in before I know that the initial creation works too.

  5. David Platten reporter

    I've now had a study from our Toshiba and Philips interventional rooms sent to OpenREM. The skin dose maps for these fail to calculate doses, as expected, and the user is shown the correct text. The correct text is also displayed on subsequent views of the studies.

    All seems well with this now, and I consider the issue closed.

  6. Log in to comment