fc13240 / dicompyler

Automatically exported from code.google.com/p/dicompyler
0 stars 0 forks source link

RT Dose files with Differential DVHs are not loaded properly #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import a RT Plan set with images, structures, plan, and dose /w differential 
DVHs

What is the expected output? What do you see instead?
The processing progresses until 100%, where it stops.

The following traceback is given:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "main.py", line 280, in LoadPatientDataThread
    dvh['min'] = dvhdoses.get_dvh_min(dvh['data'], ptdata['rxdose'])
  File "/Projects/python/dicompyler/dvhdoses.py", line 27, in get_dvh_min
    mindose = 100*mindose/doseref
UnboundLocalError: local variable 'mindose' referenced before assignment

Please use labels and text to provide additional information.

Basically, the mindose cannot be calculated, because the function assumes it is 
receiving a cDVH array. The proper fix is to convert the dDVH to to a cDVH then 
allow the calculation to proceed.

The easiest workaround is to change line 322 in dicomparser.py to:
    if self.HasDVHs():

Original issue reported on code.google.com by bastula on 7 Oct 2010 at 1:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 734afd36d4.

Original comment by bastula on 13 Oct 2010 at 4:58