- edited description
- changed milestone to 0.8.0
- changed component to Export: Fluoroscopy
fix rfopenskin.py, "local variable 'xray_filter_type' referenced before assignment"
Hi, I want to validate SR available from GE DISCOVERY system (SR attach to this issue). But when I try to export the CSV (for OPENSKIN) from OPENREM, the script rfopenskin.py goes into a loop with log : raised unexpected: UnboundLocalError("local variable 'xray_filter_type' referenced before assignment",) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 368, in trace_task R = retval = fun(args, kwargs) File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 623, in protected_call return self.run(args, kwargs) File "/usr/local/lib/python2.7/dist-packages/openrem/remapp/exports/rf_export.py", line 1156, in rfopenskin xray_filter_type, UnboundLocalError: local variable 'xray_filter_type' referenced before assignment
try: for filter in event.irradeventxraysourcedata_set.get().xrayfilters_set.all(): try: if "Copper" in filter.xray_filter_material.code_meaning: xray_filter_type = filter.xray_filter_type xray_filter_material = filter.xray_filter_material xray_filter_thickness_minimum = filter.xray_filter_thickness_minimum xray_filter_thickness_maximum = filter.xray_filter_thickness_maximum except AttributeError: xray_filter_type = '' xray_filter_material = '' xray_filter_thickness_minimum = '' xray_filter_thickness_maximum = '' except ObjectDoesNotExist: xray_filter_type = '' xray_filter_material = '' xray_filter_thickness_minimum = '' xray_filter_thickness_maximum = ''
Do you have any idea how to correct this problem ? Do you have any other SR to test ?
Comments (5)
-
-
Thank you for your bug report @ramiromoreno
You should find the Siemens Artis Zee test file in this repository will work: https://bitbucket.org/openrem/openrem/src/dd18bb88d3447a85fcf82e55ce7efdd79673a914/openrem/remapp/tests/test_files/RF-RDSR-Siemens-Zee.dcm?at=develop&fileviewer=file-view-default
Choose 'view raw' and you should be able to download it without cloning the whole repository.
-
reporter Thanks, I load the SIEMENS RDSR file to my server and openrem export without bug.
-
Rearranged xray_filters section to ensure it is always assigned before being referenced. Refs
#451→ <<cset 7dc63b58e38e>>
-
- changed status to resolved
Merged in issue451openskinexportfilterissue (pull request #118)
Rearranged xray_filters section to ensure it is always assigned before being referenced.
Fixes
#451→ <<cset 24a8091a26ad>>
- Log in to comment