L_DicomDelPresentation

#include "ltdic.h"

L_LTDIC_API L_VOID L_DicomDelPresentation(hPDU, nID)

Deletes a presentation context in the specified DICOM Associate.

Parameters

HDICOMPDU hPDU

A DICOM Associate handle.

L_UCHAR nID

Presentation ID. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data.

Returns

None.

Comments

A DICOM Associate can have multiple presentation contexts. Any of these can be deleted by passing the appropriate value for nID.

To determine the number of presentation contexts a DICOM Associate has, call L_DicomGetPresentationCount.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomDelPresentationExample(HDICOMPDU hPDU) 
{ 
   L_UCHAR i; 
   L_UCHAR nID; 
   L_UCHAR iMaxID; 
   L_TCHAR szMsg[800]; 
   L_TCHAR szTemp[800]; 
    
   /* get current ID's and display them */ 
   lstrcpy(szMsg, TEXT("Presentation Contexts")); 
   iMaxID = 0; 
   for(i = 0; i < L_DicomGetPresentationCount(hPDU); i++) 
   { 
      nID = L_DicomGetPresentation(hPDU, i); 
      wsprintf(szTemp, TEXT("\n[%d]"), nID); 
      lstrcat(szMsg, szTemp); 
       
      //store the highest nID 
      if(nID > iMaxID) 
         iMaxID = nID; 
   }     
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK); 
    
   /* nID must be unique and odd number */ 
   nID = iMaxID + 2; 
    
   /* change the some ids and then display them all */ 
   for(i = 0; i<L_DicomGetPresentationCount(hPDU); i++) 
   { 
      L_DicomSetPresentation(hPDU, i, nID); 
      nID += 2; 
   } 
    
   lstrcpy(szMsg, TEXT("Presentation Contexts--new IDs")); 
   for(i = 0; i<L_DicomGetPresentationCount(hPDU); i++) 
   { 
      nID = L_DicomGetPresentation(hPDU, i); 
      wsprintf(szTemp, TEXT("\n[%d]"), nID); 
      lstrcat(szMsg, szTemp); 
   } 
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK); 
    
   /* add a presentation context */ 
   lstrcpy(szMsg, TEXT("Presentation Contexts--Added 1")); 
   L_DicomAddPresentation(hPDU, 1, 1, UID_CT_IMAGE_STORAGE); 
   for(i = 0; i<L_DicomGetPresentationCount(hPDU); i++) 
   { 
      nID = L_DicomGetPresentation(hPDU, i); 
      wsprintf(szTemp, TEXT("\n[%d]"), nID); 
      lstrcat(szMsg, szTemp); 
   } 
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK); 
    
   /* delete the one we added */ 
   lstrcpy(szMsg, TEXT("Presentation Contexts--Deleted 1")); 
   L_DicomDelPresentation(hPDU, 1); 
   for(i = 0; i<L_DicomGetPresentationCount(hPDU); i++) 
   { 
      nID = L_DicomGetPresentation(hPDU, i); 
      wsprintf(szTemp, TEXT("\n[%d]"), nID); 
      lstrcat(szMsg, szTemp); 
   } 
   MessageBox(NULL, szMsg, TEXT("Test"), MB_OK); 
 
   return DICOM_SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help