pombreda / dicompyler

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

Support RT Dose data that is separated by fraction #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load a dicom file (with structures in my case)
2. hit export->as anonymized DICOM
3.

What is the expected output? What do you see instead?
- Expected the export dialog would appear.

What version of the product are you using? On what operating system?
- hg tip 113:730e082a798b
- Running on current Debian testing amd64 01.May.2011.
- wxwidgets2.8 (2.8.10.1-3)
- python-wxgtk2.8 2.8.10.1-3+b2

Please provide any additional information below.
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 14614, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/home/bassler/Projects/dicompyler/dicomgui.py", line 510, in AddPatientDataTree
    self.EnableItemSelection(patient, dose, filearray)
  File "/home/bassler/Projects/dicompyler/dicomgui.py", line 564, in EnableItemSelection
    for planid, plan in patient['plans'].iteritems():
KeyError: 'plans'
Traceback (most recent call last):
  File "./baseplugins/anonymize.py", line 54, in pluginMenu
    dlgAnonymize.Init()
  File "./baseplugins/anonymize.py", line 238, in Init
    pub.sendMessage('preferences.requested.value', 'general.dicom.import_location')
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 811, in sendMessage
    self.__topicTree.sendMessage(aTopic, message, onTopicNeverCreated)
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 498, in sendMessage
    deliveryCount += node.sendMessage(message)
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 336, in sendMessage
    listener(message)
  File "/home/bassler/Projects/dicompyler/preferences.py", line 98, in GetPreferenceValue
    pub.sendMessage(msg.data, v[query[0]][query[1]][query[2]])
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 811, in sendMessage
    self.__topicTree.sendMessage(aTopic, message, onTopicNeverCreated)
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 498, in sendMessage
    deliveryCount += node.sendMessage(message)
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py", line 336, in sendMessage
    listener(message)
  File "/home/bassler/Projects/dicompyler/dicomgui.py", line 122, in OnImportPrefsChange
    self.txtDicomImport.SetValue(self.path)
  File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 14564, in __getattr__
    raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the DicomImporterDialog object has 
been deleted, attribute access no longer allowed.

Original issue reported on code.google.com by niels.bassler on 1 May 2011 at 8:12

GoogleCodeExporter commented 9 years ago
The first traceback seems like an issue if the RT plan is missing from the data 
set. There are conditionals that should catch that. I wonder why it's failing. 
I can look into that issue after you get a chance to anonymize the data.

Regarding the second traceback, I deleted the preferences.txt in my 
~/.dicompyler folder, only loaded CTs and the RT structure file from the 
testdata, using hg r730e082a798b and it seems to work fine. I also loaded the 
exported data back in and it looks ok.

Give it a shot with the testdata and see if that works.

Original comment by bastula on 1 May 2011 at 8:41

GoogleCodeExporter commented 9 years ago
The first traceback is probably due to RT plan part could not be loaded:

HIT-Test_12C_01_Mimi.RTIMAGE 
.Spezial_01HIT_BPL_.6.4.2011.01.21.14.00.05.757.75851190.IMA is a RT Image 
Storage file and is not currently supported.

deleting the preferences.txt helped, I could read different DICOM test files 
and export these. Going back to the original file then breaks it again, 
apparently it is linked with those non-supported files.

Loading those RT Image Storage files manually with pydicom works alright.

Original comment by niels.bassler on 1 May 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Do you mean going back to the original preferences.txt or going back to the 
original DICOM data? Is it possible for you to send a copy of the data that 
doesn't work (via dropbox or other means)?

Currently, I have not enabled support for RT Images, but eventually dicompyler 
will support all DICOM formats. It's just a matter of adding a line in dicomgui.

The only issue is that a plugin needs to be written to display those particular 
formats. In the case of RT Images, the 2D viewer can easily show them; I just 
need a way of figuring out whether the user wants to see the CT data, RT 
images, or both. As of now, the main focus is on CT images so the 2D viewer 
assumes it is getting serial slices.

Original comment by bastula on 1 May 2011 at 9:04

GoogleCodeExporter commented 9 years ago
I deleted preferences.txt AND go back to the original DICOM test data, all was 
ok then. About the dataset, I just have to check the permission first, then I 
will make it available and let you know.

Regarding the viewing: In PyTRiP I added a box where one could select which 
data should be viewed. 
http://aptg-trac.phys.au.dk/pytrip/attachment/wiki/Screenshots/pytrip_rev67_1.pn
g
(Note the tabbed panel at the bottom, you might need something similar, sooner 
or you will run out of space...)

Original comment by niels.bassler on 1 May 2011 at 9:16

GoogleCodeExporter commented 9 years ago
Got the OK to distribute the DICOM RT Ion sample files (thanks to O. Jäkel 
from HIT). I uploaded a tarball here:

http://neptun.phys.au.dk/~bassler/DKFZ/DICOM/

apparently the error messages from the non-supported dose plans seem to provoke 
the aforementioned DeadObject error.

Original comment by niels.bassler on 3 May 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Hi Niels,

Thanks for uploading the data. I have downloaded a copy and I will try to take 
a look within the next week or so.

Adit

Original comment by bastula on 12 May 2011 at 3:13

GoogleCodeExporter commented 9 years ago
RT Ion Plan is now supported as of r7f6368d37bb6 and I can anonymize the data 
set you provided and also read it back into dicompyler.

The dose data still cannot be displayed in the 2D view, as it seems that each 
of them are fraction objects. If this is correct, then in order to display the 
dose properly, all the dose objects need to be summed together. However, the 
referenced fractions all point to Fraction #1.

I think this now is a more general issue of RT Dose format than RT Ion, so I am 
changing the issue summary.

Original comment by bastula on 19 Oct 2011 at 4:13