C# Class ClearCanvas.Dicom.DicomUid

Class used to represent a DICOM unique identifier (UID).
Mostra file Open project: jasper-yeh/ClearCanvas Class Usage Examples

Public Methods

Method Description
DicomUid ( string uid, string desc, UidType type ) : System

Constructor.

Equals ( object obj ) : bool

Override that compares if two DicomUid instances are equal.

GenerateUid ( ) : DicomUid

This routine generates a DICOM Unique Identifier.

The UID generator uses a GUID to generate the UID, as descriped in DICOM CP-1156: ftp://medical.nema.org/medical/dicom/final/cp1156_ft.pdf The UID is composed of the following components:

UID Component Description 2.25 The UID root for GUID UIDs as per CP-1156. GUID as Integer The GUID is converted to an integer and displayed in base 10, which can be up to 39 characters long.

The UID generator uses the above components to ensure uniqueness. It simply converts a GUID acquired by a call to Guid.NewGuid into an integer and appends it to the UID for uniqueness.

GetHashCode ( ) : int

An override that determines a hash code for the instance.

ToString ( ) : string

Override that displays the type of the UID if known, or else the UID value itself.

Private Methods

Method Description
ConvertGuid ( System.Guid guid ) : string
FormatGuidAsString ( System.Guid guid ) : string

Formats a GUID as a big decimal string of digits.

GuidToSystemEndianBytes ( System.Guid guid ) : byte[]

Converts the 128-bits of a GUID into a byte stream of 4x 32-bit words, respecting the system endianess so that the MSB of the GUID is the MSB of the first word, and LSB of the GUID is the LSB of the last word.

ObsoleteGenerateUid ( ) : DicomUid

Method Details

DicomUid() public method

Constructor.
public DicomUid ( string uid, string desc, UidType type ) : System
uid string The UID string.
desc string A description of the UID.
type UidType The type of the UID.
return System

Equals() public method

Override that compares if two DicomUid instances are equal.
public Equals ( object obj ) : bool
obj object
return bool

GenerateUid() public static method

This routine generates a DICOM Unique Identifier.

The UID generator uses a GUID to generate the UID, as descriped in DICOM CP-1156: ftp://medical.nema.org/medical/dicom/final/cp1156_ft.pdf The UID is composed of the following components:

UID Component Description 2.25 The UID root for GUID UIDs as per CP-1156. GUID as Integer The GUID is converted to an integer and displayed in base 10, which can be up to 39 characters long.

The UID generator uses the above components to ensure uniqueness. It simply converts a GUID acquired by a call to Guid.NewGuid into an integer and appends it to the UID for uniqueness.

public static GenerateUid ( ) : DicomUid
return DicomUid

GetHashCode() public method

An override that determines a hash code for the instance.
public GetHashCode ( ) : int
return int

ToString() public method

Override that displays the type of the UID if known, or else the UID value itself.
public ToString ( ) : string
return string