[dicompyler-plugins] push by flounder.sdt@gmail.com - Plansum: fixed issue where dose would not sum (Issue #4) on 2014-11-25 14:01 GMT

7 views
Skip to first unread message

dicompyle...@googlecode.com

unread,
Nov 25, 2014, 9:02:07 AM11/25/14
to dicompyle...@googlegroups.com
Revision: 1f7851c97779
Branch: default
Author: flound...@gmail.com
Date: Tue Nov 25 13:53:59 2014 UTC
Log: Plansum: fixed issue where dose would not sum (Issue #4)
https://code.google.com/p/dicompyler-plugins/source/detail?r=1f7851c97779

Modified:
/plugins/plansum/plansum.py

=======================================
--- /plugins/plansum/plansum.py Sat Aug 2 14:49:25 2014 UTC
+++ /plugins/plansum/plansum.py Tue Nov 25 13:53:59 2014 UTC
@@ -1,11 +1,12 @@
try:
- from dicompyler import dicomgui, guiutil
+ from dicompyler import dicomgui, guiutil, util
except ImportError:
#Running as __main__, not as a plugin
pass

import wx
from wx.lib.pubsub import Publisher as pub
+from wx.xrc import XmlResource
import numpy as np
import dicom
import matplotlib.mlab as mlab
@@ -32,6 +33,27 @@
'http://code.google.com/p/dicompyler-plugins/wiki/plansum'

return props
+def ImportDicom(parent):
+ """Prepare to show the dialog that will Import DICOM and DICOM RT
files."""
+
+ # Load the XRC file for our gui resources
+ res = XmlResource(util.GetResourcePath('dicomgui.xrc'))
+
+ dlgDicomImporter = res.LoadDialog(parent, "DicomImporterDialog")
+ dlgDicomImporter.Init(res)
+
+ # Show the dialog and return the result
+ if (dlgDicomImporter.ShowModal() == wx.ID_OK):
+ value = dlgDicomImporter.GetPatient()
+ #pub.sendMessage('patient.updated.raw_data', value)
+ else:
+ value = {}
+ # Block until the thread is done before destroying the dialog
+ if dlgDicomImporter:
+ dlgDicomImporter.t.join()
+ dlgDicomImporter.Destroy()
+
+ return value

class plugin:

@@ -61,7 +83,7 @@

def pluginMenu(self, evt):
"""Open a new RT Dose object and sum it with the current dose"""
- self.ptdata = dicomgui.ImportDicom(self.parent)
+ self.ptdata = ImportDicom(self.parent)

if (self.ptdata['rtplan'].SeriesInstanceUID != \
self.rtplan.SeriesInstanceUID):
Reply all
Reply to author
Forward
0 new messages