Openskin: patient position incorrect if patient_orientation_modifier is missing in dataset

Issue #557 resolved
Luuk
created an issue

If patient_orientation_modifier is missing in the dataset the patient position (patPos) will end on a 'N', eg: 'HFN' or 'FFN'. This is due to the fact that the first character of none is taken instead of the first character of 'supine' or 'prone'

Suggestion for fix: in make_skin_map in make_skin_map.py change

        pat_pos_source = u'assumed'
        if study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all()[0].patient_table_relationship_cid:
            patPos = str(study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all(
                        )[0].patient_table_relationship_cid)[0] + "f" + str(study.projectionxrayradiationdose_set.get(
                        ).irradeventxraydata_set.all()[0].patient_orientation_modifier_cid)[0]
            patPos = patPos.upper()
            pat_pos_source = u'extracted'
        else:
            patPos = u'HFS'

to

        pat_pos_source = u'assumed'
        if study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all()[0].patient_table_relationship_cid:
            patPos = str(study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all(
                        )[0].patient_table_relationship_cid)[0] + "f"
            if study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all(
                )[0].patient_orientation_modifier_cid:
                patPos = patPos + str(study.projectionxrayradiationdose_set.get(
                        ).irradeventxraydata_set.all()[0].patient_orientation_modifier_cid)[0]
                pat_pos_source = u'extracted'
            else:
                patPos = patPos + 'S'
                pat_pos_source = u'partly extracted'
            patPos = patPos.upper()
        else:
            patPos = u'HFS'

Comments (6)

  1. Log in to comment