#include "ltdic.h"
L_LTDIC_API L_VOID L_DicomDelPresentation(hPDU, nID)
Deletes a presentation context in the specified DICOM Associate.
A DICOM Associate handle.
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.
None.
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
Win32, x64, Linux.
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 nIDif(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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
