DICOM_Attribute_Get

 

Return the pointer to a specific DICOM tag from a linked list of tags.

 

 

Syntax

 

DICOM_List * DICOM_Attribute_Get(

          HWND hwnd,

          DICOM_Root *root,

          DICOM_List *head,

                    unsigned short group,

                    unsigned short elem,

                    char silent = 0

) ;

 

DICOM_List * DICOM_Attribute_Get(

          HWND hwnd,

          DICOM_Root *root,

          DICOM_List *head,

          char *group,

                    char *elem,

                    char silent = 0

) ;

 

 

Parameters

 

hwnd

Current Window. (Note "hwnd" is also an external variable, so you don't have to search very far to find it.)

 

root

Pointer to a "root" structure that need to be initialized.

 

head

Pointer to the head of a chained tag list

 

group

Group of the desired tag.  This can be expressed in hexadecimal or as a character string.  The value 0xFFFF is used as a wild card.

 

elem

Element of the desired tag.  This can be expressed in hexadecimal or as a character string.  The value 0xFFFF is used as a wild card.

 

silent

          Must always be "0" (the default value).

 

 

 

Return value

 

This function return a pointer to the desired tag if it was found in the list.  NULL otherwise.

 

 

Remarks

 

 

 

Requirements

 

Header:

          TomoVision_DICOM.hpp

 

 

Library:

          TomoVision_DICOM.lib

 

 

Example

 

#include "TomoVision_Convert.hpp"

#include "TomoVision_DICOM.hpp"

 

// ----------------------------------------------------------------------------

//

//          Function:          Get_Frame_Of_Reference_UID

//

//          Parameters:          frame (SliceO_Frame *)

//          Returns:          (char *)

//

//          fetch this frame's "Frame of Reference UID" tag (0020,00052)

//

// ----------------------------------------------------------------------------

char *Get_Frame_Of_Reference_UID( SliceO_Frame *frame )

{

 

          // --- make sure we start with a clean slate ---

          DICOM_Root local_root ;

          DICOM_Attribute_Sequence_Reset( hwnd, &local_root ) ;

 

              ...

 

              // --- get the frame's header ---

              Tomo_Image *header = (Tomo_Image *) frame->m_ima ;

 

              // --- Get the FoR from the image's header ---

              DICOM_List *tag_FoR_UID = DICOM_Attribute_Get( hwnd, &local_root, header->DICOM_org, 0x0020, 0x0052 ) ;

              if ( tag_FoR_UID ) {

                    char **str = NEMA_Value_Str( hwnd, tag_FoR_UID ) ;

                    if ( str )

                        strcpy( FoR_UID, *str ) ;

              }

 

          ...

 

          return( FoR_UID ) ;

}

 

See also