ivoflipse / pydicom

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

Tag objects created from two arguments have incorrect group/elem values if elem is zero #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. new_tag = dicom.tag.Tag(0x0002, 0x0000)
2. str(new_tag)
What is the expected output? What do you see instead?
Expected:  '(0002, 0000)'
Actual:  '(0000, 0002)'
What version of the product are you using?
0.9.3

The test for the second argument in the constructor of Tag will return false if 
the second argument 
is zero.  The tag then becomes a 4-byte integer with the group value in the 
least significant bytes.

Obviously this isn't a problem if Tag is always constructed using tuples.

Original issue reported on code.google.com by tentacle...@googlemail.com on 24 Nov 2009 at 9:52

GoogleCodeExporter commented 9 years ago
just needs explicit "arg2 is None" check rather than boolean "if arg2" (but 
should
also have unit test added).

Original comment by darcymason@gmail.com on 27 Nov 2009 at 4:53

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8acf5e867e.

Original comment by darcymason@gmail.com on 22 Dec 2009 at 3:55