#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 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 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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.