L_DicomFindNextAbstract

#include "ltdic.h"

L_LTDIC_API L_UCHAR L_DicomFindNextAbstract(hPDU, nID, pszUID)

HDICOMPDU hPDU;

a DICOM Associate handle

L_UCHAR nID;

presentation ID

L_TCHAR * pszUID;

abstract syntax

Finds the Presentation Context with the specified Abstract Syntax.

Parameter

Description

hPDU

A DICOM Associate handle.

nID

The presentation ID of the Presentation Context, within the DICOM Associate, to start the search.

pszUID

Character string that contains the Abstract String to find. For a list of possible values, refer to Abstract Syntax Values. This parameter cannot exceed PDU_MAX_UID_SIZE + 1, including the null character at the end.

Returns

The presentation ID of the Presentation Context, within the DICOM Associate, that has the specified Abstract Syntax.  Returns 0 if no presentation context is found that contains the abstract syntax.

Comments

This method finds the next presentation context that contains the specified Abstract Syntax.  The search starts with the specified presentation ID (nID).  This function is useful if an Abstract Syntax appears in more than one presentation context.  See the example to see how to list all presentation contexts that contain a particular abstract syntax.

The Abstract Syntax provides information about the class type of the data that will be transferred across the DICOM Associate connection.

This function is valid only for DICOM Associate objects of type Associate Request.

To get the Abstract Syntax of a specific Presentation Context, call L_DicomGetAbstract.

To set the Abstract Syntax of a specific Presentation Context, call L_DicomSetAbstract.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

Platforms

Win32, x64, Linux.

See Also

Functions:

L_DicomGetAbstract, L_DicomSetAbstract, L_DicomGetAbstractCount

Topics:

Working with DICOM Associate Connections

Example

This example creates an association, and adds an abstract syntax to more than one presentation context. It then uses the GetAbstractCount and FindNextAbstract methods to examine the association.

L_VOID DicomFindNextAbstractExample() 
{ 
   //create the Associate Class as Request 
   HDICOMPDU hPDU = L_DicomCreateAssociate(TRUE); 
   L_DicomResetAssociate(hPDU, TRUE); 
   L_DicomAddPresentation(hPDU, 1, PDU_ACCEPT_RESULT_SUCCESS, UID_VERIFICATION_CLASS); 
   L_DicomAddTransfer(hPDU, 1, UID_IMPLICIT_VR_LITTLE_ENDIAN); 
   L_DicomAddPresentation(hPDU, 3, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   L_DicomAddTransfer(hPDU, 3, UID_IMPLICIT_VR_LITTLE_ENDIAN); 
   L_DicomAddPresentation(hPDU, 5, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   L_DicomAddTransfer(hPDU, 5, UID_EXPLICIT_VR_LITTLE_ENDIAN); 
   L_DicomAddPresentation(hPDU, 7, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   L_DicomAddTransfer(hPDU, 7, UID_RLE_LOSSLESS); 
   L_DicomAddPresentation(hPDU, 9, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   L_DicomAddTransfer(hPDU, 9, UID_JPEG2000); 
   L_TCHAR szMsg[200]; 
   // Get the number of times the abstract syntax UID_CT_IMAGE_STORAGE occurs 
   L_INT nAbstractCount = L_DicomGetAbstractCount(hPDU, UID_CT_IMAGE_STORAGE); 
   wsprintf(szMsg, TEXT("Abstract Count: %d\n"), nAbstractCount); 
   OutputDebugString(szMsg); 
   // Get the presentation IDs that contain the abstract syntax UID_CT_IMAGE_STORAGE 
   L_UCHAR uID = L_DicomFindAbstract(hPDU, UID_CT_IMAGE_STORAGE); 
   while (uID != 0) 
   { 
      wsprintf(szMsg, TEXT("\tPresentation Context: %d\n"), uID); 
      OutputDebugString(szMsg); 
      uID = L_DicomFindNextAbstract(hPDU, uID, UID_CT_IMAGE_STORAGE); 
   } 
   // Free the associate 
   L_DicomFreeAssociate(hPDU); 
} 

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS DICOM C API Help