How to generate SOPInstance UID for DICOM file?
Question:
I am developing a system which will be able to create structured report for PACS.
Obviously in order to create a DICOM instance (file containing Report data), I need three UIDs for Study, Series and Instance. StudyUID and SeriesUID must be the same as that of study and series that report is created for. But for SOPInstanceUID, I need to generate new UID.
I have seen getNewSOPInstanceUID
method in Pixelmed documentation, but I am not familiar with the Pixelmed source. I need an algorithm or Python source.
Answers:
According to the DICOM standard (PS 3.5-2011 Page 61), you need an orgroot and a suffix. Examples can be found here (PS 3.5-2011 Page 83).
Also do not forget that UI Fields have to be padded (if they do not have an even length) with ‘
I am developing a system which will be able to create structured report for PACS.
Obviously in order to create a DICOM instance (file containing Report data), I need three UIDs for Study, Series and Instance. StudyUID and SeriesUID must be the same as that of study and series that report is created for. But for SOPInstanceUID, I need to generate new UID.
I have seen getNewSOPInstanceUID
method in Pixelmed documentation, but I am not familiar with the Pixelmed source. I need an algorithm or Python source.
According to the DICOM standard (PS 3.5-2011 Page 61), you need an orgroot and a suffix. Examples can be found here (PS 3.5-2011 Page 83).
Also do not forget that UI Fields have to be padded (if they do not have an even length) with ‘