Class TagDictionary

Class TagDictionary

Namespace: Aspose.Medical.Dicom.Tags
Assembly: Aspose.Medical.dll (25.11.0)

The class is intended to look up tags in a dictionary for relevant information such as VR type, value multiplicity.

public sealed class TagDictionary

Inheritance

object TagDictionary

Inherited Members

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Fields

PrivateCreatorTag

Metadata for private elements in the ranges (gggg, 0001-000F) and (gggg, 0100-0FFF) where gggg is odd. http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.8.html .

public static readonly TagMetadata PrivateCreatorTag

Field Value

TagMetadata

UnknownTag

Metadata for not registered (unknown) tags.

public static readonly TagMetadata UnknownTag

Field Value

TagMetadata

Properties

Default

The top-level dictionary is intended to provide metadata about standard DICOM tags, register Private Creator elements. Read-only Aspose.Medical.Dicom.Tags.TagDictionary.

public static TagDictionary Default { get; }

Property Value

TagDictionary

PrivateCreator

Associated private creator for the private elements and null for standard elements. Read-only Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator.

public PrivateCreator? PrivateCreator { get; }

Property Value

PrivateCreator ?

this[Tag]

Returns metadata for the given tag.

public TagMetadata this[Tag tag] { get; }

Property Value

TagMetadata

Methods

Add(Tag, TagMetadata)

Adds (registers) the given tag and its metadata to this tag dictionary. If the given tag is not private, then it must be registered in standard dictionary (i.e. Aspose.Medical.Dicom.Tags.TagDictionary.Default). If the given tag is private, then it must be registered in private dictionary (i.e. Aspose.Medical.Dicom.Tags.TagDictionary with not nullAspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator). While registering a tag in private dictionary, the tag’s Aspose.Medical.Dicom.Tags.Tag.Creator will be updated according to the Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator of this dictionary.

public void Add(Tag tag, TagMetadata metadata)

Parameters

tag Tag

A tag to be registered.

metadata TagMetadata

Metadata of the given tag.

Exceptions

ArgumentException

Unable to add not private tag into private dictionary.

Add(TagMask, TagMetadata)

Adds (registers) the given mask and its metadata to this tag dictionary.

public void Add(TagMask mask, TagMetadata metadata)

Parameters

mask TagMask

Tag mask that defines (reserves) range of tags.

metadata TagMetadata

Metadata describing tags corresponding to the given mask.

Exceptions

MedicalApiException

Private Creator can only be set for private tags.

  • or Metadata related to wrong mask (mask != metadata.MaskedTag)

FindByKeyword(string)

Returns the Aspose.Medical.Dicom.Tags.Tag for a given keyword.

public Tag? FindByKeyword(string keyword)

Parameters

keyword string

The keyword.

Returns

Tag ?

The matching Aspose.Medical.Dicom.Tags.Tag or null if none is found.

GetPrivateCreator(string)

Returns the registered Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator for the given creator if it is already registered; otherwise, registers the private creator and returns the registered Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator.

public PrivateCreator GetPrivateCreator(string creator)

Parameters

creator string

A private creator for which Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator to be found.

Returns

PrivateCreator

The Aspose.Medical.Dicom.Tags.TagDictionary.PrivateCreator.

Exceptions

ArgumentException

Private creator can only be registered in Default dictionary.

GetPrivateDictionary(PrivateCreator)

Returns a Aspose.Medical.Dicom.Tags.TagDictionary intended to manage private elements related to the given privateCreator.

public TagDictionary GetPrivateDictionary(PrivateCreator privateCreator)

Parameters

privateCreator PrivateCreator

A private creator for which private dictionary to be found / created.

Returns

TagDictionary

Exceptions

ArgumentException

Nested private dictionaries are not allowed.

  • or
  • GetPrivateDictionary was called outside of Default dictionary.

Load(string)

Loads DICOM Tag Dictionary from the specified file.

public void Load(string file)

Parameters

file string

File name (full file path).

Exceptions

DirectoryNotFoundException

The specified path is invalid, (for example, it is on an unmapped drive).

MedicalApiException

Can’t read the specified document.