Recalculate DVH's

205 views
Skip to first unread message

Rhonda Flynn

unread,
Jul 5, 2018, 9:44:00 AM7/5/18
to dicompyler
Hi Aditya,

I am a Med Phys Masters student looking to create a plugin for dicompyler to recalculate DVH's from dicom data using EQD2. I am new to python and have tried to play around with the source code to understand how to implement alpha/beta values for regional data found by dicompyler and feed it into a graph, exactly like the DVH baseplugin..just recalculated.

Do you know how I can approach doing this? I have tried to create a notebook tab type plugin but my lack of XRC doc knowledge is going against me as I want to basically create the plugin with your source code by tweaking it to add in the equation and cant seem to see where it would fit. I have also tried a menu item type plugin but am failing also. I think maybe using dicompyler-core might help but I don't know how to implement that into a plugin. Any help would be greatly appreciated!

Excuse my ignorance if you can I'm very new to coding, apologies!

Many thanks and kind regards,
Rhonda

Aditya Panchal

unread,
Jul 5, 2018, 10:31:43 PM7/5/18
to dicom...@googlegroups.com
Hi Rhonda,

You should be able to edit dvh.py and change the code in the last 3 functions. Basically you need to modify self.dvh so it becomes an EQD2 DVH. This is the object that the UI will render on the graph and on the controls. Once you have made your changes you can overwrite the dvh.py located in baseplugins or place it in the userplugins folder.

Is your plugin expected to recalculate all DVHs in the data set or just the selected structure? If the former, you could apply the correction in batch using pydicom/dicompyler-core to the dose grid in the RT Dose DICOM file itself and dicompyler will pick up the changes. The latter situation was described above.

Hope that helps,

Aditya

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en
---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rhonda Flynn

unread,
Jul 8, 2018, 7:26:51 AM7/8/18
to dicom...@googlegroups.com
Hi Aditya,

Thank you for your reply. I have been trying your suggestions since and unfortunately still having trouble.

To answer your question first, I need to recalculate all structures on the one DVH with user adjustable dose per frac per plan and also user adjustable alpha/beta per struct. 

My main questions are:
1) I understand dicompyler-core is callable but where do I call it? do I need to write a script for a plugin using it or should I call it in the baseplugin dvh.py?
2) (this one might seem stupid-sorry!) when you say 'apply the correction in batch'...what do you mean? 
3) is the best way to do this to create a menu tab type plugin with a popup gui for the inputs to then recalc? If so where is dicompyler-core used in said plugin?

Any help is hugely appreciated! Also, congratulations on your program, its very intuitive.

Many thanks and kind regards,
Rhonda

Aditya Panchal

unread,
Jul 12, 2018, 11:54:03 AM7/12/18
to dicom...@googlegroups.com
Hi Rhonda,

I think for now don't worry about dicompyler-core or batch processing.

I would either modify the dvh.py plugin or create a new menu plugin. If you need UI to change the alpha/beta per structure and dose per frac, you should probably create a new plugin to display those elements. Then the plugin would modify the DICOM raw data and re-publish it using:
pub.sendMessage('patient.updated.raw_data', self.data)

You can see an example of menu plugins in the plugins repo (GFOVswitch, plansum, etc):

You don't need to know XRC as you can hand code the dialog if you want. The G4Dose plugin has a lot more code but does utilize this method without XRC:

I would actually even skip the dialog initially and maybe hard code values to make sure you are getting the results you want.

Thanks for the kind words about the project.

Hopefully these examples will lead you in the right direction.

Aditya
Reply all
Reply to author
Forward
0 new messages