如何使用 dcm4che 在 DICOM 中创建 new/custom 标签?
How can I create new/custom tags in DICOM using dcm4che?
我想向 DICOM 数据集添加一些私有 data/information。此数据不适合任何标准 DICOM 标签。
所以,我想使用 dcm4che 在 DICOM 数据集中添加一些特定的 new/custom 标签,这些标签不在 DICOM 库中。
如何使用 dcm4che 在 DICOM 中创建 new/custom 标签?
您正在寻找Private Data Element Tags;那些由 DICOM 支持。任何带有奇数组号的标签都是私有标签。所以标签 (0x00210011) [DicomTag(33, 17)]
变成了私人标签。
Private Data Elements have the same structure as Standard Data Elements specified earlier in Section 7.1 (i.e., Data Element Tag field, optional VR field, length field, and value field). The Group Number used in the Element Tag of Private Data Elements shall be an odd number. Private Data Elements shall be contained in the Data Set in increasing numeric order of Data Element Tag. The Value Field of a Private data element shall have one of the VRs specified by this standard in Section 6.2.
another guide用框图说明:
It is possible that multiple implementers may define Private Elements with the same (odd) group number. To avoid conflicts, Private Elements shall be assigned Private Data Element Tags according to the following rules.
- Private Creator Data Elements numbered (gggg, 0010-00FF) (gggg is odd) shall be used to reserve a block of Elements with Group Number gggg for use by an individual implementer. The implementer shall insert an identification code in the first unused (unassigned) Element in this series to reserve a block of Private Elements. The VR of the private identification code shall be LO (Long String) and the VM shall be equal to 1.
- Private Creator Data Element (gggg, 0010), is a Type 1 Data Element that identifies the implementer reserving element (gggg, 1000-10FF), Private Creator Data Element (gggg, 0011) identifies the implementer reserving elements (gggg, 1100-11FF), and so on, until Private Creator Data Element (gggg, 00FF) identifies the implementer reserving elements (gggg, FF00 -FFFF). The total number of blocks that can be reserved and later used within one group is thus 0XFF - 0X10 = 240.
参考讨论这个的。
使用 dcm4che,您可以像添加任何其他标签一样添加它;只需明确指定标签,而不是使用 Tag.StudyTime
.
之类的东西
Attributes attribs = new Attributes();
attribs.setString(0x00210011, VR.LO, "your data");
我想向 DICOM 数据集添加一些私有 data/information。此数据不适合任何标准 DICOM 标签。
所以,我想使用 dcm4che 在 DICOM 数据集中添加一些特定的 new/custom 标签,这些标签不在 DICOM 库中。
如何使用 dcm4che 在 DICOM 中创建 new/custom 标签?
您正在寻找Private Data Element Tags;那些由 DICOM 支持。任何带有奇数组号的标签都是私有标签。所以标签 (0x00210011) [DicomTag(33, 17)]
变成了私人标签。
Private Data Elements have the same structure as Standard Data Elements specified earlier in Section 7.1 (i.e., Data Element Tag field, optional VR field, length field, and value field). The Group Number used in the Element Tag of Private Data Elements shall be an odd number. Private Data Elements shall be contained in the Data Set in increasing numeric order of Data Element Tag. The Value Field of a Private data element shall have one of the VRs specified by this standard in Section 6.2.
another guide用框图说明:
It is possible that multiple implementers may define Private Elements with the same (odd) group number. To avoid conflicts, Private Elements shall be assigned Private Data Element Tags according to the following rules.
- Private Creator Data Elements numbered (gggg, 0010-00FF) (gggg is odd) shall be used to reserve a block of Elements with Group Number gggg for use by an individual implementer. The implementer shall insert an identification code in the first unused (unassigned) Element in this series to reserve a block of Private Elements. The VR of the private identification code shall be LO (Long String) and the VM shall be equal to 1.
- Private Creator Data Element (gggg, 0010), is a Type 1 Data Element that identifies the implementer reserving element (gggg, 1000-10FF), Private Creator Data Element (gggg, 0011) identifies the implementer reserving elements (gggg, 1100-11FF), and so on, until Private Creator Data Element (gggg, 00FF) identifies the implementer reserving elements (gggg, FF00 -FFFF). The total number of blocks that can be reserved and later used within one group is thus 0XFF - 0X10 = 240.
参考讨论这个的
使用 dcm4che,您可以像添加任何其他标签一样添加它;只需明确指定标签,而不是使用 Tag.StudyTime
.
Attributes attribs = new Attributes();
attribs.setString(0x00210011, VR.LO, "your data");