ivoflipse / pydicom

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

IndexError raised on writing zero length AT element #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We have some CT images with a tag of VR AT but zero length. The files are
read fine, but fail to write with an IndexError in filewriter.py. 

Looking at filereader.py, the tag is read as an empty list. The code in
filewriter.py tests for a list by attempting to access
data_element.value[1] expecting a TypeError but actually gets the
IndexError instead.

I have used iter(data_element.value) as a test instead, which better
matches the routine in readfile.py and only raises TypeError. This seems to
work in our case as the else clause of the try seems to handle the empty list.

I am using pydicom-0.9.3 python-2.6

Ron H-D

Original issue reported on code.google.com by Ron.Hart...@gmail.com on 2 Feb 2010 at 6:41

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry to take a while to acknowledge this issue and your solution. I've been 
putting 
together the package for release 0.9.4, and I should be able to include this in 
it.

Original comment by darcymason@gmail.com on 9 Feb 2010 at 3:10

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 77ab201249.

Original comment by darcymason@gmail.com on 12 Feb 2010 at 3:54