#include "ltdic.h"
L_VOID LDicomAssociate::DelPresentation(nID)
Deletes a presentation context in the DICOM Associate.
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 LDicomAssociate::GetPresentationCount.
Required DLLs and Libraries
Win32, x64
L_INT LDicomAssociate_DelPresentationExample(LDicomAssociate* m_pDicomAssociate){L_INT nRet;L_INT i;L_UCHAR nID, nMaxID;CString strMsg, strTmp;//create the Associate Class as Requestm_pDicomAssociate = new LDicomAssociate(TRUE);//set the Associate to the defaultm_pDicomAssociate->Default();//get current ID's and display themstrMsg = TEXT("Presentation Contexts");nMaxID = 0;for (i = 0; i < m_pDicomAssociate->GetPresentationCount(); i++){nID = m_pDicomAssociate->GetPresentation(i);strTmp.Format(TEXT("\n[%d] = %d"),i, nID);strMsg = strMsg + strTmp;//store the highest nIDif (nID > nMaxID)nMaxID = nID;}AfxMessageBox(strMsg);//nID must be unique and odd numbernID = nMaxID + 2;//delete presentation context that has presentation ID = 1m_pDicomAssociate->DelPresentation(1);//change the presentation context at index 3nRet = m_pDicomAssociate->SetPresentation(3,1);if(nRet != DICOM_SUCCESS){return nRet;}//add a presentation contextstrMsg = TEXT("Presentation Contexts--Added 1");nRet = m_pDicomAssociate->AddPresentation( 9, PDU_ACCEPT_RESULT_SUCCESS, UID_CT_IMAGE_STORAGE);if(nRet != DICOM_SUCCESS)return nRet;for (i = 0 ; i < m_pDicomAssociate->GetPresentationCount() ; i++){nID = m_pDicomAssociate->GetPresentation(i);strTmp.Format(TEXT("\n[%d] = %d"),i, nID);strMsg = strMsg + strTmp;}AfxMessageBox(strMsg);//delete the one we addedstrMsg = TEXT("Presentation Contexts--Deleted 9");m_pDicomAssociate->DelPresentation(9);for (i = 0; i<m_pDicomAssociate->GetPresentationCount(); i++){nID = m_pDicomAssociate->GetPresentation(i);strTmp.Format(TEXT("\n[%d] = %d"),i, nID);strMsg = strMsg + strTmp;}AfxMessageBox(strMsg);//Free associatedelete m_pDicomAssociate;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
