如何生成唯一的DICOM UID? [英] How to generate unique DICOM UID?

查看:1191
本文介绍了如何生成唯一的DICOM UID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理DICOM门控(PET)数据.
我想人为地创建一个包含门控数据的DICOM图像系列.我正在查询SOPInstanceUID的增量值,该增量值标记了每个相位或门中的每个图像切片.

I am working on DICOM gated (PET) data.
I would like to artificially create a DICOM image series which includes gated data. I am inquiring on the increment values of SOPInstanceUID which labels each image slice in each phase or gate.

对于门中的每个切片,这些值具有不同的值,并且在门之间递增.但是我找不到如何选择此值的逻辑.

These have different values for each slice in a gate and are incremented between gates but I can't find out the logic to how this value is chosen.

是否引用了这些值的写入位置和方式?

Is there a reference to where and how these values are written?

推荐答案

答案中解释了多种用于生成DICOM UID的算法.

Multiple algorithms to generate DICOM UID are explained in this answer with their drawbacks.

根据DICOM 规范,所有UID包括有问题的SOPInstanceUID应该是唯一的.这与您正在处理的数据(门控PET数据或其他数据)无关.

As per DICOM specifications, all UIDs including SOPInstanceUID in question should be unique. This is irrelevant to what data (gated PET data or other) you are working on.

以下是来自规格的信息:

Following is from specifications:

2017a第5部分-数据结构和编码( 9个唯一标识符(UID))

唯一标识符(UID)提供了唯一标识各种项目的功能.它们保证了在多个国家,站点,供应商和设备之间的唯一性.在DICOM话语领域中,可以区分不同类别的对象,对象实例和信息实体,而与任何语义上下文无关.

Unique Identifiers (UIDs) provide the capability to uniquely identify a wide variety of items. They guarantee uniqueness across multiple countries, sites, vendors and equipment. Different classes of objects, instance of objects and information entities can be distinguished from one another across the DICOM universe of discourse irrespective of any semantic context.

UID由两部分组成:

UID consists of two parts:

  1. 组织根:
    UID的这一部分确保了整个组织的唯一性.有些服务提供商免费提供此服务.我所知道的是Medical Connections.您可以与他们联系以免费获取它们.

  1. Organization root:
    This part of UID ensures the uniqueness across organizations. There are service providers who offer this for free. Medical Connections is the one I am aware about. You can contact them to get the one for free.

后缀:
此外,您应该以确保组织内部唯一性的方式生成后缀.

Suffix:
Further, you should generate suffix in such a way that it guarantees uniqueness inside your organization.

以下是DICOM UID的常规规则:

Following are the general rules for DICOM UID:

  1. 总长度必须< = 64个字符,包括停止符
  2. 只能包含数字0-9和句号
  3. 每个数字组成部分"(停靠点之间)必须是有效且明确的整数,因此不能有前导零(除非整个组成部分为零)
  4. 必须保证唯一-这意味着:
    • 它必须来自您唯一控制的适当官方根源.
    • 不得通过在其他人的UID后面附加数字(但是您认为组合很特殊!)来创建它.
    • 特别是,不得将用于辅助捕获图像,KIN对象等的系列UID创建为研究UID的派生类(除非您拥有该根!)
  1. Total length must be <= 64 characters, including the stops
  2. Must contain only digits 0-9 and full stops
  3. Each numeric "component" (between stops) must be a valid and unambiguous integer number, and so must not have a leading zero (unless the whole component is zero)
  4. Must be guaranteed to be unique - this means:
    • It must be derived from a proper official root under your sole control.
    • It must not be created by appending digits (however special you consider the combination!) to someone else's UID.
    • In particular, series UIDs for secondary capture images, KIN objects etc. must not be created as derivatives of the Study UID (unless you own that root!)
  • 每台机器都有唯一的根目录(通常是您公司的UID根目录+机器特定的后缀,例如序列号
  • 如果可能以每秒> 1的速度生成UID,则还应使用顺序计数器
  • 如果在多线程计算机上,则需要线程ID或正确互锁的计数器,以防止2个应用程序或同一应用程序中的2个线程同时生成相同的UID.
  • 不要单独使用时间-最终以0开头很容易-例如20060724.093017改用20060724093017
  • Each machine has a unique root (normally your company UID root + a machine specific suffix such as a serial number
  • If it is possible for UIDs to be generated at > 1 per second, then a sequential counter should also be used
  • if on a multi-threaded machine, then the thread ID or a properly interlocked counter are needed to prevent 2 applications or 2 threads in the same application from generating identical UIDs simultaneously.
  • Do not use time on its own - it is too easy to end up with a leading zero 0 - e.g. 20060724.093017 use instead 20060724093017

可以在规范中找到.

Same can be found in specifications.

以下示例来自DICOM规范以生成UID.请注意,这是信息部分.

Following example is from DICOM Specifications to generate UID. Please note that this is Informative section.

2017a第5部分-数据结构和编码( B创建私有定义的唯一标识符(信息性))

B.1组织衍生的UID:

以下示例展示了由特定人员做出的特定选择 组织定义其后缀以确保SOP的唯一性 实例UID.

The following example presents a particular choice made by a specific organization in defining its suffix to guarantee uniqueness of a SOP Instance UID.

"1.2.840.xxxxx.3.152.235.2.12.187636473"

"1.2.840.xxxxx.3.152.235.2.12.187636473"

在此示例中,根为:

  • 1 标识ISO
  • 2 标识ANSI成员正文
  • 840 特定成员机构的国家/地区代码(美国为ANSI)
  • xxxxx 标识特定的组织.(由ANSI分配)
  • 1 Identifies ISO
  • 2 Identifies ANSI Member Body
  • 840 Country code of a specific Member Body (U.S. for ANSI)
  • xxxxx Identifies a specific Organization.(assigned by ANSI)

在此示例中,后缀的前两个部分与 设备的标识:

In this example the first two components of the suffix relate to the identification of the device:

  • 3 制造商定义的设备类型
  • 152 制造商定义的序列号
  • 3 Manufacturer defined device type
  • 152 Manufacturer defined serial number

后缀的其余四个组成部分与 图片识别:

The remaining four components of the suffix relate to the identification of the image:

  • 235 研究编号
  • 2 序列号
  • 12 图片编号
  • 187636473 图像采集的编码日期和时间戳记
  • 235 Study number
  • 2 Series number
  • 12 Image number
  • 187636473 Encoded date and time stamp of image acquisition

在此示例中,组织选择了这些组件来 保证唯一性.其他组织可能会选择完全 不同系列的组件来唯一标识其图像.为了 例如,省略学习编号可能是完全有效的, 如果时间戳足够,则序列号和图像编号 精度,以确保没有两个图像可能具有相同的日期和 时间戳记.由于DICOM标准允许的灵活性 在创建组织派生的UID时,实现不应 取决于任何假定的UID结构,并且不应尝试 解析UID以提取其某些组件的语义.

In this example, the organization has chosen these components to guarantee uniqueness. Other organizations may choose an entirely different series of components to uniquely identify its images. For example it may have been perfectly valid to omit the Study Number, Series Number and Image Number if the time stamp had a sufficient precision to ensure that no two images might have the same date and time stamp. Because of the flexibility allowed by the DICOM Standard in creating organizationally derived UIDs, implementations should not depend on any assumed structure of UIDs and should not attempt to parse UIDs to extract the semantics of some of its components.

规范中还提到了另一种方法

There is one more way mentioned in specifications

2017a第5部分-数据结构和编码( B创建私有定义的唯一标识符(信息性))

B.2 UUID派生的UID:

UID可以从根"2.25"构造.后跟通用唯一标识符(UUID)的十进制表示形式.该十进制表示形式将128位UUID视为整数,因此最长为​​39位(必须禁止前导零).
派生自UUID的UID可能适用于动态创建的UID,例如SOP实例UID,但通常不适用于在应用程序软件设计过程中确定的UID,例如私有SOP类或传输语法UID或实现类UID.

UID may be constructed from the root "2.25." followed by a decimal representation of a Universally Unique Identifier (UUID). That decimal representation treats the 128 bit UUID as an integer, and may thus be up to 39 digits long (leading zeros must be suppressed).
A UUID derived UID may be appropriate for dynamically created UIDs, such as SOP Instance UIDs, but is usually not appropriate for UIDs determined during application software design, such as private SOP Class or Transfer Syntax UIDs, or Implementation Class UIDs.

这篇关于如何生成唯一的DICOM UID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆