DICOM_Attribute_Sequence_Reset

 

Due to the recursive nature of DICOM structures, you need a "reference" structure.  The "root" structure must always be "reset" before you start digging in the DICOM tags.

 

Syntax

 

DICOM_Attribute_Sequence_Reset(

          HWND hwnd,

          DICOM_Root *local_root

) ;

 

Parameters

 

hwnd

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

 

local_root

Pointer to a DICOM_Root structure.

 

 

Return value

 

This function

 

 

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