DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomAssociation Class / PcidFor Method
The SOP class to test for
Example

In This Topic
    PcidFor Method
    In This Topic
    Indicates the presentaiton context ID which would be used to send an instance of the given SOP class
    Syntax
    'Declaration
     
    
    Public Function PcidFor( _
       ByVal SOPClass As System.String _
    ) As System.Byte
    public System.byte PcidFor( 
       System.string SOPClass
    )

    Parameters

    SOPClass
    The SOP class to test for

    Return Value

    Either the presentation context ID which would be used to send an instance of the stated SOP class, or 0 if so suitable, agreed presentation context exists.

    Remarks

    This routines uses the properties AgreedContexts, MetaSOPClass, PreferredPCID, PreferredTS and PreferredTSList

    Example
    DicomImage CTImage = new DicomImage("CTImage.dcm");
    DicomImage MRImage = new DicomImage("MRImage.dcm");
                        
    DicomImageCollection dicomImages = new DicomImageCollection();
    dicomImages.Add(CTImage);
    dicomImages.Add(MRImage);
                        
    string node = "dicomserver.co.uk";
    int port = 104;
    string callingAE = "SCU";
    string calledAE = "SCP";
                        
    using (DicomAssociation cn = new DicomAssociation())
    {
        cn.RequestedContexts.Add(CTImage.SOPClass, TransferSyntaxes.ExplicitVRLittleEndian);
        cn.RequestedContexts.Add(MRImage.SOPClass, TransferSyntaxes.ExplicitVRLittleEndian);
        cn.Open(node, port, callingAE, calledAE);
        
        var pcidCT = cn.PcidFor(CTImage.SOPClass); // 1
        var pcidMR = cn.PcidFor(MRImage.SOPClass); // 3
        
        cn.SendInstances(dicomImages);    
        var result = cn.LastStatus;
        
        cn.Close();
    }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also