Closed suever closed 10 years ago
From darcymason@gmail.com on June 23, 2009 15:29:33
This looks like a question of setting the wrong object type -- an item in a Sequence needs to be a Dataset instance. Probably what is needed here is: f.PatientSetups[0].FixationDevices[2].AccessoryCode = '1234567-890'
However, the code should test that an item assignment is in fact a Dataset. I'll create that as an issue for the issue list.
Status: Fixed
From howard.b...@gmail.com on June 23, 2009 20:53:49
Thank you! --Bryan
From howard.b...@gmail.com on June 23, 2009 15:24:29
What steps will reproduce the problem? 1. f=dicom.ReadFile( 'Rt_Ion_Plan.dcm' )
Details: (1) Unzip attached tar file ModifyFixationDevicesBug.tar.bz2 into temp directory. (2) python ModifyingFixationDevicesCorruptsDataStructures.py What version of the product are you using? On what operating system? 0.9.2 (bug also occurs with 0.9.3) Please provide any additional information below. python import dicom f=dicom.ReadFile( 'RT_Ion_Plan_pt00000030.dcm' ) print str(f) <<>>
(300a, 0180) Patient Setup Sequence 1 item(s) ----
(0018, 5100) Patient Position CS: 'HFS'
(300a, 0182) Patient Setup Number IS: '1'
(300a, 0190) Fixation Device Sequence 5 item(s) ----
(300a, 00f9) Accessory Code LO: '1008756-001'
(300a, 0192) Fixation Device Type CS: 'WHOLE_BODY_POD'
(300a, 0194) Fixation Device Label SH: 'MPSS_SHORT_EXT'
(300a, 0196) Fixation Device Description ST: 'Table
Extension, Short Head Pod'
Short Head Pod'
Pillow, Medium'
mouthpiece'
<<>>
f.PatientSetups[0].FixationDevices[2] = '1234567-890' ###### CORRUPTS FILE
dicom.WriteFile( 'Corrupted_TR_Ion_Plan_pt00000030.dcm', f )
Traceback (most recent call last): File "ModifyingFixationDevicesCorruptsDataStructures.py", line 48, in