LDicomAssociate::DelTransfer

#include "ltdic.h"

L_VOID LDicomAssociate::DelTransfer(nID, nIndex)

Deletes a Transfer Syntax from the specified Presentation Context.

Parameters

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.

L_INT nIndex

The index of the Transfer Syntax to delete. This index is zero-based.

Returns

None.

Comments

A DICOM Associate (Request or Accept) can have multiple Presentation Contexts. A DICOM Associate Request can have multiple Transfer Syntax entries for each Presentation Context. A Transfer Syntax can be deleted by specifying the ID for the appropriate Presentation Context and the index for the appropriate Transfer Syntax.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

L_INT LDicomAssociate_DelTransferExample(LDicomAssociate* m_pDicomAssociate) 
{ 
   L_INT nRet; 
   long i; 
   CString cStr; 
   L_INT nTransferSyntaxCount; 
   L_UCHAR nID; 
 
   L_TCHAR szTransfer[PDU_MAX_UID_SIZE]; 
 
   //m_pDicomAssociate is a member variable declared as: 
   //    LDicomAssociate *m_pDicomAssociate; 
 
   //create the Associate Class as Request 
   m_pDicomAssociate = new LDicomAssociate(TRUE); 
 
   //set the Associate to the default 
   m_pDicomAssociate->Default(); 
 
   //display each Transfer Syntax for the first Presentation Context 
   cStr = TEXT("Transfer Syntax"); 
   nID = m_pDicomAssociate->GetPresentation(0); 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount(nID); 
   for (i = 0; i<nTransferSyntaxCount; i++) 
   { 
      m_pDicomAssociate->GetTransfer(nID, i, szTransfer, PDU_MAX_UID_SIZE); 
 
      cStr += TEXT("\n"); 
 
      cStr += szTransfer; 
   } 
   AfxMessageBox(cStr); 
 
   //add a transfer syntax 
   nRet = m_pDicomAssociate->AddTransfer(nID, UID_IMPLICIT_VR_LITTLE_ENDIAN); 
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
 
   //display each Transfer Syntax for the first Presentation Context 
   cStr = TEXT("Transfer Syntax--add a transfer syntax"); 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID); 
   for (i = 0; i<nTransferSyntaxCount; i++) 
 
  { 
 
      m_pDicomAssociate->GetTransfer( nID, i, szTransfer, PDU_MAX_UID_SIZE); 
 
      cStr += TEXT("\n"); 
 
      cStr += szTransfer; 
 
  } 
   AfxMessageBox(cStr); 
 
   //change them 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID); 
 
   for (i = 0 ; i < nTransferSyntaxCount ; i++) 
   { 
      nRet = m_pDicomAssociate->SetTransfer( nID, i, UID_EXPLICIT_VR_BIG_ENDIAN); 
      if(nRet != DICOM_SUCCESS) 
         return nRet; 
   } 
 
   //display each Transfer Syntax for the first Presentation Context 
   cStr = TEXT("Transfer Syntax--changed"); 
 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID); 
 
   for (i = 0; i<nTransferSyntaxCount; i++) 
   { 
 
       m_pDicomAssociate->GetTransfer( nID, i, szTransfer, PDU_MAX_UID_SIZE); 
 
       cStr += TEXT("\n"); 
 
       cStr += szTransfer;  
   } 
 
   AfxMessageBox(cStr); 
 
   //delete the last one 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID); 
 
   m_pDicomAssociate->DelTransfer( nID, nTransferSyntaxCount - 1); 
 
   //display each Transfer Syntax for the first Presentation Context 
   cStr = TEXT("Transfer Syntax--delete last one"); 
 
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID); 
 
   for (i = 0; i<nTransferSyntaxCount; i++) 
 
  { 
 
      m_pDicomAssociate->GetTransfer( nID, i, szTransfer, PDU_MAX_UID_SIZE); 
 
        cStr += TEXT("\n"); 
 
        cStr += szTransfer; 
 
   } 
   AfxMessageBox(cStr); 
 
   //Free associate 
   delete m_pDicomAssociate; 
 
   return DICOM_SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

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