LAUREL BRIDGE

LaurelBridge.DCF.Examples.EchoSCU Namespace

DICOM Connectivity Framework V3.4
The EchoSCU example demonstrates how to use DCF to create a VerificationSCU and perform a C-Echo to a VerificationSCP.
Classes

  ClassDescription
Public classProgram
A simple echo client example that shows how to do a DICOM ping. This program should be run with a Verification SCP running on localhost listening on port 104 by default.
Examples

EchoSCU Sample Code
public class Program
{
    /// <summary>
    /// Main entry point for EchoSCU.
    /// </summary>
    [STAThread]
    public static void Main()
    {
        try
        {
            AssociationInfo ai = new AssociationInfo();
            ai.CalledTitle = "SCP";
            ai.CallingTitle = "SCU";
            ai.CalledPresentationAddress = "localhost:104";

            VerificationSCU scu = new VerificationSCU("SCU", new DicomAddress("localhost", 104, "SCP"));
            scu.RequestAssociation();
            // do a DICOM ping with a 30 second timout
            CEchoResponse response = scu.CEcho(30);
            scu.ReleaseAssociation();

            Console.WriteLine("c-Echo returned {0}", response.Status);
        }
        catch (Exception e)
        {
            Console.WriteLine("Exception caught during execution: {0}{1}{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();
        }
    }