suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

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

Closed suever closed 9 years ago

suever commented 9 years ago

From tentacle...@googlemail.com on November 24, 2009 16:52:15

What steps will reproduce the problem? 1. new_tag = dicom.tag.Tag(0x0002, 0x0000)

  1. 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: http://code.google.com/p/pydicom/issues/detail?id=64

suever commented 9 years ago

From darcymason@gmail.com on November 26, 2009 20:53:32

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

Status: Accepted
Labels: -Difficulty-Medium Difficulty-Easy

suever commented 9 years ago

From darcymason@gmail.com on December 21, 2009 19:55:23

This issue was closed by revision 8acf5e867e .

Status: Fixed
Mergedinto: -