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

{
   long i;
   CString cStr;
   L_INT nTransferSyntaxCount;
   L_UCHAR nID;
   
   //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 = "Transfer Syntax";
   nID = m_pDicomAssociate->GetPresentation(0);
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount(nID);
   for (i = 0; i<nTransferSyntaxCount; i++)
   {
      cStr = cStr + "\n" + m_pDicomAssociate->GetTransfer(nID, i);
   }
   AfxMessageBox(cStr);
   
   //add a transfer syntax
   m_pDicomAssociate->AddTransfer(nID, UID_IMPLICIT_VR_LITTLE_ENDIAN);
   
   //display each Transfer Syntax for the first Presentation Context
   cStr = "Transfer Syntax--add a transfer syntax";
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID);
   for (i = 0; i<nTransferSyntaxCount; i++)
      cStr = cStr + "\n" + m_pDicomAssociate->GetTransfer( nID, i);
   AfxMessageBox(cStr);
   
   //change them
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID);
   for (i = 0; i<nTransferSyntaxCount; i++)
      m_pDicomAssociate->SetTransfer( nID, i, UID_EXPLICIT_VR_BIG_ENDIAN);
   
   //display each Transfer Syntax for the first Presentation Context
   cStr = "Transfer Syntax--changed";
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID);
   for (i = 0; i<nTransferSyntaxCount; i++)
   {
      cStr = cStr + "\n" + m_pDicomAssociate->GetTransfer( nID, i);
   }
   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 = "Transfer Syntax--delete last one";
   nTransferSyntaxCount = m_pDicomAssociate->GetTransferCount( nID);
   for (i = 0; i<nTransferSyntaxCount; i++)
      cStr = cStr + "\n" + m_pDicomAssociate->GetTransfer( nID, i);
   AfxMessageBox(cStr);
   
   //Free associate
   delete m_pDicomAssociate;
}