LAUREL BRIDGE

LaurelBridge.DCF.Examples.VerificationSCU Namespace

DICOM Connectivity Framework V3.4
The VerificationSCU example demonstrates how to use DCF to implement a verification (DICOM echo) service class user.
Classes

  ClassDescription
Public classProgram
Simple verification service class user which should should be used with VerificationSCP.
Examples

VerificationSCU Sample Code
public class Program
{
    /// <summary>
    /// Main entry point for VerificationSCU.
    /// </summary>
    [STAThread]
    public static void Main()
    {
        try
        {
            using (DCF.Dicom.Verification.VerificationSCU verificationSCU =
                new Dicom.Verification.VerificationSCU("ECHOSCU", new DicomAddress("127.0.0.1", 104, "TESTSCP")))
            {
                verificationSCU.RequestAssociation();
                CEchoResponse status = verificationSCU.CEcho(30);
                Console.WriteLine("VerificationSCU: cEcho status on port 104: {0}",
                    status.Status == DimseStatus.DIMSE_SUCCESS ? "success" : "failure");
                verificationSCU.ReleaseAssociation();
            }

            using (DCF.Dicom.Verification.VerificationSCU verificationSCU =
                new Dicom.Verification.VerificationSCU("ECHOSCU", new DicomAddress("127.0.0.1", 105, "TESTSCP")))
            {
                verificationSCU.RequestAssociation();
                CEchoResponse status = verificationSCU.CEcho(30);
                Console.WriteLine("VerificationSCU: cEcho status on port 105: {0}",
                    status.Status == DimseStatus.DIMSE_SUCCESS ? "success" : "failure");
                verificationSCU.ReleaseAssociation();
            }

            using (DCF.Dicom.Verification.VerificationSCU verificationSCU =
                new Dicom.Verification.VerificationSCU("ECHOSCU", new DicomAddress("127.0.0.1", 106, "TESTSCP")))
            {
                verificationSCU.RequestAssociation();
                CEchoResponse status = verificationSCU.CEcho(30);
                Console.WriteLine("VerificationSCU: cEcho status on port 106: {0}",
                    status.Status == DimseStatus.DIMSE_SUCCESS ? "success" : "failure");
                verificationSCU.ReleaseAssociation();
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("Exception caught during execution: {0}{1}Please verify the Verification SCP is up and running.",
                e, Environment.NewLine);
        }

        if (System.Diagnostics.Debugger.IsAttached)
        {
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey();
        }
    }
}