ImageGear .NET v25.1 - Updated
Metadata
User Guide > How to Work with... > DICOM > Working with DICOM Content > Metadata

ImageGear .NET uses its general metadata engine for all file formats, including DICOM. When ImageGear loads a DICOM image, it builds a metadata tree structure and attached it to the new ImGearPage Class object. Use ImageGear .NET Metadata support classes to access data items in this tree.

A DICOM file includes one header with metadata, and zero, one, or multiple images. Metadata applies to all images in the file. ImageGear loads a copy of DICOM metadata into every loaded page. DICOM Document metadata is empty.

See DICOM Metadata Structure for detailed information about the DICOM Metadata tree structure.

DICOM tags map to ImageGear metadata tags as follows:

Tag group number, element number

ImGearMetadataNode.Tag Property

Value Representation ImGearMetadataLeaf.NativeType Field
Value Length Not stored explicitly. Application can use string and array lengths instead.
Value Multiplicity (Item count) Not stored explicitly. For values of OB/OW/OF it is always 1. For other Value Representations, if data is singular it is 1, otherwise it is equal to the length of the data array.
Data ImGearMetadataLeaf.Data Property

"Sequence" (SQ) tags are represented by nested metadata trees. SQ contains one or more Sequence Items, and cannot contain normal DICOM tags. Sequence Item contains a set of DICOM tags.

The following tags are read from the file, but not added to the metadata tree:

The following table lists the mapping between DICOM Value Representations and .NET system types: 

VR Meaning System Type to which It Converts on Reading Allowed System Types on Writing
AE Application Entity String String
AS Age String String String
AT Attribute Tag String String
CS Code String String String
DA Date String String
DS Decimal String double all numeric types, String
DT Date Time String String
FL Floating Point Single float all numeric types, String
FD Floating Point Double double all numeric types, String
IS Integer String long (64-bit) all integer types, String
LO Long String String String
LT Long Text String String
OB Other Byte String byte[] byte[]
OW Other Word String ushort[] ushort[]
PN Person Name String String
SH Short String String String
SL Signed Long int all integer types, String
SQ Sequence - -
SS Signed Short short all integer types, String
ST Short Text String String
TM Time String String
UI Unique Identifier String String
UL Unsigned Long uint all integer types, String
UN Unknown byte[] byte[]
US Unsigned Short ushort all integer types, String
UT Unlimited Text String String
OF Other Float String float[] float[], double[]

For types other than OB, OW and OF, if the system type is an array, a multivalued data element is saved.

Example of conversion on metadata reading:

VR Tag Value Metadata Leaf Data Type Metadata Leaf Value
US 0x0001 ushort 1
OW 0x0001 0x0002 0x0003 ushort[] {1, 2, 3}
DS "0.12345\0.6789" double[] {0.12345, 0.6789}
CS "MR" string "MR"
CS "ORIGINAL\PRIMARY" string[] {"ORIGINAL", "PRIMARY"}