I want to rearrange non medical DICOM-data. Using pydicom I want to produce a DICOMDIR with at least one additional tag. For each Series I want to add the Series Description like this:
(0008, 103e) Series Description LO: '7253 1mm'
This should enable a DICOM-Viewer to show this information in the treeview as a series-label.
Are there any hints how to do this for each series? I cannot find an exhaustive explanation in the pydicom documentation.
That's how I collect the dcm-files and write a DICOMDIR:
from os.path import isdir, join
from pydicom.fileset import FileSet
path2dcm = r"D:\my\path\to\dcm-files"
instanceList =[]
def ListFolderEntries (path):
for entry in listdir(path):
npath = (join(path,entry))
if isdir(npath):
ListFolderEntries(npath)
else:
instanceList.append(npath)
#walk through folders recursively
ListFolderEntries (path2dcm)
for Inst in instanceList:
myFS.add(Inst)
#Here perhaps add the series Desicription?
myFS.write() #creates the file structure and a DICOMDIR
Thanks
SeriesDescriptionis not in the list of allowed additional tags in a DICOMDIR, so a viewer will probably not show it even if added.