LDicomAssociate::DelTransfer

#include "ltdic.h"

L_VOID LDicomAssociate::DelTransfer(nID, nIndex)

L_UCHAR nID;

/* presentation ID */

L_INT nIndex;

/* index */

Deletes a Transfer Syntax from the specified Presentation Context.

Parameter

Description

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.

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

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LDicomAssociate::GetTransfer, LDicomAssociate::SetTransfer, LDicomAssociate::GetTransferCount, LDicomAssociate::AddTransfer

Topics:

Working with DICOM Associate Connections

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;
}