A very simple pydicom
examples involves reading a file and then outputting the Series Time
:
import pydicom
info = pydicom.dcmread("file.dcm")
print(info.SeriesTime)
So for an object having been read, dot notation is a working alternative to more complicated constructs such as print(info[pydicom.tag.Tag((0x0008, 0x0031))])
or print(info[0x0008, 0x0031])
. Nice.
Now, pydicom
supports reading only some tags for improved performance:
info = pydicom.dcmread("file.dcm", specific_tags=['SeriesTime', ])
I dislike the use of string constants in code. So what are readable alternatives to 'SeriesTime'
in the above example? specific_tags=[pydicom.tag.Tag((0x0008, 0x0031)), ]
is not particularly readable.
Ideally, I would expect to be able to access a dictionary of tags by dot notation, such as pydicom.allTags.SeriesTime
, but I cannot seem to find that.