How to generate SOPInstance UID for a DICOM file?

I am developing a system that can create a structured report for PACS.

Obviously, to create a DICOM instance (a file containing report data), I need three UIDs for Study, Series and Instance. StudyUID and SeriesUID should be the same as for the study and series for which the report was created. But for SOPInstanceUID I need to generate a new UID.

I saw the method getNewSOPInstanceUIDin the Pixelmed documentation, but I am not familiar with the source of Pixelmed. I need a Python algorithm or source.

+3
source share
4 answers

. UUID, . MAC-, , C.

UUID DICOM, UID , UUID .

YOUR_ORG_ROOT.CONVERTED_UUID

, 64 ( , . ) :

  • UUID VR: ([0-9.]+)
  • ( )
  • Org Root
  • \0 (0 ) .

, python, uuid lib python-uuid.

+1

DICOM UID. UID UUID. DICOM CP-1156. UID UID , UID UID, UID SOP UUID DICOM UID.

UUID. DICOM # GUID.

private static string GuidToUidStringUsingStringAndParse(Guid value)
{
    var guidBytes = string.Format("0{0:N}", value);
    var bigInteger = BigInteger.Parse(guidBytes, NumberStyles.HexNumber);
    return string.Format(CultureInfo.InvariantCulture, "2.25.{0}", bigInteger);
}
+7

DICOM standard (PS 3.5-2011 . 61) orgroot . (PS 3.5-2011).

, ( ) '\ 0', .

UID :

YOUR_ORGROOT.Year.Month.Day.Hour.Minute.Second.Milliseconds.StaticCounter

, 64 !

+2

DICOM UID.

A] [ ]

, SeriesInstanceUID 1. , SeriesInstanceUID "1.1.1.1.1", SOPInstanceUID "1.1.1.1. 2" "1.1.1.1.1. 1".

:

  • , .
  • .
  • /.

B] [ ]

, , ( ) .

:

  • .
  • .
  • /.

C] []

1.2.840.xxxxx.30.152.99999.235.20.100.yyyyMMddHHmmss.zzzzzz

:

1.2.840.xxxxx:
30:
152:
99999: /
235:
20:
100:
yyyyMMddHHmmss:
zzzzzz: /

:

  • , ; / . ; .

D] UUID UID []

UID "2.25". (UUID).

:

  • This may be useful for dynamically created UIDs, such as UIDs of SOP instances, but is not suitable for UIDs defined at design time, such as private SOP class identifiers or Syntax wrapper or implementation class UIDs.
  • UID is limited to only 28 bits. DICOM UID supports a wider range.
+2
source

All Articles