NEMA_Value_...

 

Functions to read the value stored in DICOM tags structures (DICOM_List *)

·NEMA_Value_Date() for dates (VR=DA and DT)

·NEMA_Value_Time() for times (VR=TM and DT)

·NEMA_Value_Name() for names (VR=PN)

·NEMA_Value_Str() for character strings (VR=AE, CS, LO, SH, UI, AS, LT, ST, UT, OB and UN)

·NEMA_Value_Hex() for hexadecimal values (VR=OB, OW, OX and UN)

·NEMA_Value_Int() for integer values (VR=DS, IS, SS, SL, US, UH, AT, UL and OW)

·NEMA_Value_Float() for floating point values (VR=IS, DS, FL and FD)

 

Syntax

 

TomoVision_Date * NEMA_Value_Date(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

TomoVision_Time * NEMA_Value_Time(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

TomoVision_Name * NEMA_Value_Name(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

char ** NEMA_Value_Str(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

char * NEMA_Value_Hex(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

int * NEMA_Value_Int(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

float * NEMA_Value_Float(

          HWND hwnd,

          DICOM_List *tag,

          unsigned short vr=0

) ;

 

Parameters

 

hwnd

Current Window. (Note: You can use the "hwnd" external variable, so you don't have to search very far to find it.)

 

tag

Pointer to a tag.

 

vr

Current VR (by default, it is extracted from the tag parameter).

 

 

Return value

 

This function return a vector of pointers to the desired element types.

 

 

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