Adding additional attributes when using AddToDirectory
Only the mandatory elements (and one or two others we’ve been talked into adding) are put into the DICOMDIR by the AddToDirectory (.NET version) or AddToDirectory (COM version) method, but you can add others yourself very easily.
The AddToDirectory method returns a 4 item DicomDataSetCollection (.NET) or DicomDataSets collection(COM), and the 4 items are references to the 4 datasets referred to (existing or created as necessary) by that method call.
The Structure of DICOMDIR DICOMDIR acts as a “Directory” for DICOM file sets and holds a full 4 level hierarchy (PATIENT –> STUDY –> SERIES –> IMAGE) as shown below:
DICOMDIR files can be read using DicomDataSets.ReadDirectory method in DicomObjects and the complex structure of linked lists with offsets is held in a single DicomDataSet object.
When accessing the DICOMDIR, you may bear in mind that different DICOM attributes (or Tags) belong to different levels, for example PatientName is a Patient Level attribute, StudyUID is a Study Level attribute, Modality is Series Level and Image Number is Image Level.