Table of Contents

Class DicomPersonName

Namespace
Egami.Formats.Extended.Dicom
Assembly
Egami.Formats.Extended.dll

A Person Name (PN) value: up to three component groups, alphabetic, ideographic and phonetic, separated by =; the alphabetic one split into its five components (PS3.5 section 6.2.1).

[Experimental("EGAMIX001", UrlFormat = "https://github.com/inexin/Egami/blob/main/docs/articles/formats/dicom.md")]
public sealed record DicomPersonName : IEquatable<DicomPersonName>
Inheritance
DicomPersonName
Implements
Inherited Members

Examples

DicomDataset data = file.Dataset;
DateOnly? studyDate = data["StudyDate"]?.GetDate();
DicomPersonName? patient = data["PatientName"]?.GetPersonName();
double[] window = data["WindowCenter"]?.GetNumbers() ?? [];

// A sequence is a list of datasets; text decodes by the dataset's Specific Character Set.
foreach (DicomDataset item in data["ContentSequence"]?.Items ?? [])
{
    Console.WriteLine(item.GetString("ReferencedSOPClassUID"));
}

// Every element prints as a dump line, such as "(0028,0010) US Rows: 4".
foreach (DicomElement element in data)
{
    Console.WriteLine(element);
}

Constructors

DicomPersonName(string, string, string)

A Person Name (PN) value: up to three component groups, alphabetic, ideographic and phonetic, separated by =; the alphabetic one split into its five components (PS3.5 section 6.2.1).

public DicomPersonName(string Alphabetic, string Ideographic, string Phonetic)

Parameters

Alphabetic string

The alphabetic group, such as Doe^John^^Dr..

Ideographic string

The ideographic group, or empty.

Phonetic string

The phonetic group, or empty.

Examples

DicomDataset data = file.Dataset;
DateOnly? studyDate = data["StudyDate"]?.GetDate();
DicomPersonName? patient = data["PatientName"]?.GetPersonName();
double[] window = data["WindowCenter"]?.GetNumbers() ?? [];

// A sequence is a list of datasets; text decodes by the dataset's Specific Character Set.
foreach (DicomDataset item in data["ContentSequence"]?.Items ?? [])
{
    Console.WriteLine(item.GetString("ReferencedSOPClassUID"));
}

// Every element prints as a dump line, such as "(0028,0010) US Rows: 4".
foreach (DicomElement element in data)
{
    Console.WriteLine(element);
}

Properties

Alphabetic

The alphabetic group, such as Doe^John^^Dr..

public string Alphabetic { get; init; }

Property Value

string

FamilyName

Gets the family name: the alphabetic group's first component.

public string FamilyName { get; }

Property Value

string

GivenName

Gets the given name: the second component.

public string GivenName { get; }

Property Value

string

Ideographic

The ideographic group, or empty.

public string Ideographic { get; init; }

Property Value

string

MiddleName

Gets the middle name: the third component.

public string MiddleName { get; }

Property Value

string

NamePrefix

Gets the name prefix, such as a title: the fourth component.

public string NamePrefix { get; }

Property Value

string

NameSuffix

Gets the name suffix: the fifth component.

public string NameSuffix { get; }

Property Value

string

Phonetic

The phonetic group, or empty.

public string Phonetic { get; init; }

Property Value

string

Methods

ToString()

Returns the name as the file writes it, groups joined by = and empty trailing groups left out.

public override string ToString()

Returns

string

The name.