LDicomAssociate::FindNextAbstract

Summary

Finds the next Presentation Context that contains the specified Abstract Syntax.

Syntax

#include "ltdic.h"

L_UCHAR LDicomAssociate::FindNextAbstract(nID, pszUID)

Parameters

L_UCHAR nID

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

L_TCHAR * pszUID

Character string that contains the Abstract String to find. For a list of possible values, refer to Abstract Syntax Values.

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 function 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 LDicomAssociate::GetAbstract.

To set the Abstract Syntax of a specific Presentation Context, call LDicomAssociate::SetAbstract.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

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_INT LDicomAssociate_FindNextAbstractExample() 
{ 
   L_INT nRet = -1; 
 
   //create the Associate Class as Request 
   LDicomAssociate *pDicomAssociate = new LDicomAssociate(TRUE); 
   pDicomAssociate->Reset(TRUE); 
 
   nRet = pDicomAssociate->AddPresentation(1, PDU_ACCEPT_RESULT_SUCCESS, UID_VERIFICATION_CLASS); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddTransfer(1, UID_IMPLICIT_VR_LITTLE_ENDIAN); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddPresentation(3, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddTransfer(3, UID_IMPLICIT_VR_LITTLE_ENDIAN); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddPresentation(5, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddTransfer(5, UID_EXPLICIT_VR_LITTLE_ENDIAN); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddPresentation(7, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddTransfer(7, UID_RLE_LOSSLESS); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddPresentation(9, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   nRet = pDicomAssociate->AddTransfer(9, UID_JPEG2000); 
   if(nRet != DICOM_SUCCESS) 
   { 
      return nRet; 
   } 
 
   CString csMsg; 
   // Get the number of times the abstract syntax UID_CT_IMAGE_STORAGE occurs 
   L_INT nAbstractCount = pDicomAssociate->GetAbstractCount(UID_CT_IMAGE_STORAGE); 
   csMsg.Format(TEXT("Abstract Count: %d\n"), nAbstractCount); 
   OutputDebugString(csMsg); 
 
   // Get the presentation IDs that contain the abstract syntax UID_CT_IMAGE_STORAGE 
   L_UCHAR uID = pDicomAssociate->FindAbstract(UID_CT_IMAGE_STORAGE); 
   while (uID != 0) 
   { 
      csMsg.Format(TEXT("\tPresentation Context: %d\n"), uID); 
      OutputDebugString(csMsg); 
      uID = pDicomAssociate->FindNextAbstract(uID, UID_CT_IMAGE_STORAGE); 
   } 
 
   // Free the associate 
   delete pDicomAssociate; 
 
   return nRet; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.