IDLffDICOM::GetReference

The IDLffDICOM::GetReference function method takes optional DICOM group and/or element arguments and returns an array of references to matching elements in the object.

Syntax

Result = Obj->[IDLffDICOM::]GetReference([Group [, Element]] [, DESCRIPTION=string] [, VR=DICOM VR string])

Return Value

Returns an array referencing the matching elements in the object. References are opaque, meaning that they have no specific significance other than a correspondence to the element they refer to. If no arguments or keywords are specified, the returned array contains references to all elements in the object. The effect of multiple keywords and parameters is to AND their results. If no matching elements can be found, the function returns -1.

Arguments

Group

An optional argument representing the value for the DICOM group for which to search, such as ‘0018’x. If this argument is omitted, then all of the DICOM array elements are returned.

Element

An optional argument specified only if the Group argument has also been specified. Set this to the value for the DICOM element to search for, such as ‘0010’x. If this argument is omitted and the Group argument was specified, then all elements of the specified Group are returned.

Keywords

DESCRIPTION

Set this keyword to a string containing text to be searched for in each element’s DICOM description. An element will be returned only if the text in this string can be found in the description. The text comparison is case-insensitive.

VR

Set this keyword to a DICOM VR string. An element will be returned only if its value representation matches this string.

Examples

obj = OBJ_NEW('IDLffDICOM')

read = obj->Read(DIALOG_PICKFILE(FILTER = '*'))

 

; Get the reference to the patient name element:

ref = obj->GetReference('0010'x,'0010'x)

PRINT, ref

 

; Get references to all elements with "patient" in the description:

refs = obj->GetReference(DESCRIPTION = 'patient')

FOR i = 0, (N_ELEMENTS(refs) - 1) DO BEGIN

   PRINT, refs[i]

   PRINT, obj->GetDescription(REFERENCE = refs[i])

ENDFOR

 

; Get references to all elements with a VR of DA (date):

refs = obj->GetReference(vr = 'DA')

FOR i = 0, (N_ELEMENTS(refs) - 1) DO BEGIN

   PRINT, refs[i]

   PRINT, obj->GetDescription(REFERENCE = refs[i])

ENDFOR

 

OBJ_DESTROY, obj

Version History

5.2

Introduced