Пример #1
0
        static void Main(string[] args)
        {
            try
            {
                //
                // Initialise dvtk library.
                //
                Dvtk.Setup.Initialize();

                if (args.GetLength(0) == 2)
                {
                    // check file existance - config file
                    if (CheckFileExits(args[0]) == false) return;

                    // check file existance - script file
                    if (CheckFileExits(args[1]) == false) return;

                    // second argument is a VBScript
                    VisualBasicScriptSupport visualBasicScriptSupport = new VisualBasicScriptSupport();
                    visualBasicScriptSupport.ExecuteVBScript(args[1], args);
                }
                else
                {
                    // check file existance - config file
                    if (CheckFileExits(args[0]) == false) return;

                    //
                    // Get a Scheduled Workflow ihe framework
                    //
                    IheFramework iheFramework = new IheFramework("Scheduled Workflow");

                    //
                    // Configure the ihe framework
                    //
                    iheFramework.Config.Load(args[0]);

                    //
                    // Apply the Configuration to actors
                    //
                    iheFramework.ApplyConfig();

                    //
                    // Open the results after loading the configuration so that the results directory is defined
                    //
                    iheFramework.OpenResults();

                    //
                    // Add filters (as Tag Values) to the Comparator
                    //
                    // Universal Match on these DICOM Tags
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.PATIENT_ID));
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.ACCESSION_NUMBER));

                    // Single Value Match on these DICOM Tags
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.PATIENTS_BIRTH_DATE, "19000101"));
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.REQUESTED_PROCEDURE_ID, "RPQ2"));

                    //
                    // Start the ihe framework test
                    //
                    iheFramework.StartTest();

                    Console.WriteLine("");
                    Console.WriteLine("Press enter to stop...");
                    Console.ReadLine();

                    //
                    // Stop the ihe framework test
                    //
                    iheFramework.StopTest();

                    //
                    // Evaluate the results
                    //
                    iheFramework.EvaluateTest();
                    iheFramework.CleanUpCurrentWorkingDirectory();

                    //
                    // Close the results and get the final results filename
                    //
                    System.String resultsFilename = iheFramework.CloseResults();

                    //
                    // Invoke IE to display the results file
                    //
                    System.Diagnostics.Process process = new System.Diagnostics.Process();
                    process.StartInfo.FileName = resultsFilename;
                    process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
                    process.Start();
                }

                //
                // Terminate the setup
                //
                Dvtk.Setup.Terminate();
            }
            catch(System.Exception e)
            {
                Console.WriteLine("{0} - {1}", e.Message, e.StackTrace);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            try
            {
                //
                // Initialise dvtk library.
                //
                Dvtk.Setup.Initialize();

                if (args.GetLength(0) == 2)
                {
                    // check file existance - config file
                    if (CheckFileExits(args[0]) == false)
                    {
                        return;
                    }

                    // check file existance - script file
                    if (CheckFileExits(args[1]) == false)
                    {
                        return;
                    }

                    // second argument is a VBScript
                    VisualBasicScriptSupport visualBasicScriptSupport = new VisualBasicScriptSupport();
                    visualBasicScriptSupport.ExecuteVBScript(args[1], args);
                }
                else
                {
                    // check file existance - config file
                    if (CheckFileExits(args[0]) == false)
                    {
                        return;
                    }

                    //
                    // Get a Scheduled Workflow ihe framework
                    //
                    IheFramework iheFramework = new IheFramework("Scheduled Workflow");

                    //
                    // Configure the ihe framework
                    //
                    iheFramework.Config.Load(args[0]);

                    //
                    // Apply the Configuration to actors
                    //
                    iheFramework.ApplyConfig();

                    //
                    // Open the results after loading the configuration so that the results directory is defined
                    //
                    iheFramework.OpenResults();

                    //
                    // Add filters (as Tag Values) to the Comparator
                    //
                    // Universal Match on these DICOM Tags
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.PATIENT_ID));
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.ACCESSION_NUMBER));

                    // Single Value Match on these DICOM Tags
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.PATIENTS_BIRTH_DATE, "19000101"));
                    //			iheFramework.AddComparisonTagValueFilter(new DicomTagValue(Tag.REQUESTED_PROCEDURE_ID, "RPQ2"));

                    //
                    // Start the ihe framework test
                    //
                    iheFramework.StartTest();

                    Console.WriteLine("");
                    Console.WriteLine("Press enter to stop...");
                    Console.ReadLine();

                    //
                    // Stop the ihe framework test
                    //
                    iheFramework.StopTest();

                    //
                    // Evaluate the results
                    //
                    iheFramework.EvaluateTest();
                    iheFramework.CleanUpCurrentWorkingDirectory();

                    //
                    // Close the results and get the final results filename
                    //
                    System.String resultsFilename = iheFramework.CloseResults();

                    //
                    // Invoke IE to display the results file
                    //
                    System.Diagnostics.Process process = new System.Diagnostics.Process();
                    process.StartInfo.FileName    = resultsFilename;
                    process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
                    process.Start();
                }

                //
                // Terminate the setup
                //
                Dvtk.Setup.Terminate();
            }
            catch (System.Exception e)
            {
                Console.WriteLine("{0} - {1}", e.Message, e.StackTrace);
            }
        }