cutright / DVH-Analytics

A DICOM Database Application for Radiation Oncology
Other
82 stars 30 forks source link

Import-Freeze when applying custom rx_dose #116

Closed Kiragroh closed 3 years ago

Kiragroh commented 3 years ago

Hi,

found a little Bug. I used the rx_dose-overwrite-feature the first time in the Import-Assistant and doing so had made the Import-Process freeze at the beginning because the new value is given as string to the dicom_parser.

Here is the Fix: cahnge line 428 in dicom_parser.py from limit = int(self.rx_dose self.dvh_bin_max_dose[self.dvh_bin_max_dose_units]) to limit = int(float(self.rx_dose) self.dvh_bin_max_dose[self.dvh_bin_max_dose_units])

Maybe Dan will solve the problem in future updates at another point in the code but this works for now.

Hope this helps.

cutright commented 3 years ago

Thanks Max, that seems like a good fix, but I'd like to figure out why self.rx_dose isn't numeric to begin with. When you apply a new rx dose in the GUI, these lines are fired: https://github.com/cutright/DVH-Analytics/blob/4e5c3e1e14d4f2b6fd1d7fdce0d84d3b7057ff76/dvha/models/import_dicom.py#L762-L763

https://github.com/cutright/DVH-Analytics/blob/4e5c3e1e14d4f2b6fd1d7fdce0d84d3b7057ff76/dvha/models/import_dicom.py#L808-L812

I also cannot reproduce the scenario. I just imported a plan and typed in a new rx dose in the GUI. I had no import issues. I even typed in 'a' as the rx dose. This did not cause a crash, but instead just ignored the override.

So this is a bit puzzling. While I agree your proposed fix should work for you and have no negative consequences, I wonder if there are other issues.

Which version of DVHA are you using? Any customizations? Maybe this is related to DICOM and not the GUI?

cutright commented 3 years ago

Maybe it's coming from DICOM, TargetPrescriptionDose?

https://github.com/cutright/DVH-Analytics/blob/4e5c3e1e14d4f2b6fd1d7fdce0d84d3b7057ff76/dvha/db/dicom_parser.py#L1394-L1400

https://github.com/cutright/DVH-Analytics/blob/4e5c3e1e14d4f2b6fd1d7fdce0d84d3b7057ff76/dvha/db/dicom_parser.py#L1355-L1359

cutright commented 3 years ago

OK, found it: https://github.com/cutright/DVH-Analytics/blob/a31b53a0e212111201cf057dd70d39d7b5d1a451/dvha/models/import_dicom.py#L752-L786

The bug is that I didn't use the validate_dose function when doing apply all. Line 773 still uses the original string.