DICOMDIR classes

DicomDir

class DicomDir

Represents a DICOMDIR structure.

In order to work DicomDir needs a DataSet, which embeds the DicomDir’s entries.

If the DicomDir’s content is modified then the method updateDataSet() has to be called before the managed DataSet can be stored as a DICOMDIR file.

Public Functions

DicomDir()

Construct an empty DicomDir.

DicomDir(const DataSet &fromDataSet)

Construct a DicomDir from a DataSet object.

Parameters
  • fromDataSet: the DataSet created from reading a DICOMDIR file

virtual ~DicomDir()

Destructor.

DicomDirEntry *getNewEntry(directoryRecordType_t recordType)

Return a new DicomDirEntry record and insert it into the DicomDir’s DataSet.

Return
a new DicomDirEntry object that can be inserted into the DicomDir object or one of its children DicomDirEntry entries.
Parameters
  • recordType: the type of the new entry

DicomDirEntry *getFirstRootEntry() const

Retrieve the first DicomDir’s root entry.

If the root entry is missing then return a null pointer.

Return
the root DicomDirEntry or a null pointer if the root DicomDirEntry does noot exist

void setFirstRootEntry(const DicomDirEntry &firstEntryRecord)

Set the specified entry as the first DicomDir’s root record.

After the DicomDir’s content has been modified it is necessary to call updateDataSet() before the DataSet managed by DicomDir can be used.

Parameters
  • firstEntryRecord: the DicomDirEntry object to set as the first root entry

DataSet *updateDataSet()

This method has to be called to update the managed DataSet after the DicomDir’s content has been updated.

It is not necessary to call updateDataSet() after every DicomDir update, just call it when the updated DataSet object is needed.

Return
the updated managed DataSet object

DicomDirEntry

class DicomDirEntry

Represents a single DICOMDIR entry.

Each entry can be followed by a sibling entry (on the same depth level) or can point to its first child entry (one level deeper).

Each DicomDirEntry object manages a DataSet which is used to store the entry’s data. The DataSet objects managed by DicomDirEntry objects are inserted as sequence items into the DicomDir’s DataSet.

Public Functions

DataSet *getEntryDataSet()

Return the DataSet managed by the DicomDirEntry object.

Return
the DataSet managed by the DicomDirEntry object

DicomDirEntry *getNextEntry()

Return the next sibling entry (on the same depth level).

If the next DicomDirEntry is missing (this is the last entry) then return a null pointer.

Return
the next sibling DicomDirEntry object, or a null pointer if the next sibling DicomDirEntry does not exist

DicomDirEntry *getFirstChildEntry()

Return the first child entry (one level deeper).

If the first child DicomDirEntry is missing then return a null pointer.

Return
the first child DicomDirEntry object, or a null pointer if there aren’t any children

void setNextEntry(const DicomDirEntry &nextEntry)

Set the next sibling entry (one the same depth level).

Parameters

void setFirstChildEntry(const DicomDirEntry &firstChildEntry)

Set the first child entry (one level deeper).

Parameters

fileParts_t getFileParts() const

Returns the parts that form the name of the file referenced by the DicomDirEntry object.

Return
a list of strings that form the name of the file referenced by the DicomDirEntry object. The last item in the list is the file name, while the preceding items contain the folders names. For instance, on Linux the parts “folder0”, “folder1”, “fileName” represent the path “folder0/folder1/fileName”

void setFileParts(const fileParts_t &fileParts)

Set the parts that form the name of the file referenced by the DicomDirEntry object.

Parameters
  • fileParts: a list of strings that form the name of the file referenced by the DicomDirEntry object. The last item in the list is the file name, while the preceding items contain the folders names. For instance, on Linux the parts “folder0”, “folder1”, “fileName” represent the path “folder0/folder1/fileName”