예제 #1
0
        //
        // - Test methods -
        //

        private void Ticket1210_1()
        {
            if (this.ticket1210_1_DicomThread == null)
            {
                ThreadManager threadManager = new ThreadManager();
                SCP           dicomThread   = new SCP();
                dicomThread.Initialize(threadManager);

                dicomThread.Options.LocalAeTitle = "1";
                dicomThread.Options.LocalImplementationClassUid    = "2";
                dicomThread.Options.LocalImplementationVersionName = "3";
                dicomThread.Options.LocalMaximumLength             = 4;
                dicomThread.Options.LocalPort      = 5;
                dicomThread.Options.RemoteAeTitle  = "6";
                dicomThread.Options.RemoteHostName = "7";
                dicomThread.Options.RemoteImplementationClassUid    = "8";
                dicomThread.Options.RemoteImplementationVersionName = "9";
                dicomThread.Options.RemoteMaximumLength             = 10;
                dicomThread.Options.RemotePort = 11;
                dicomThread.Options.DefinitionFileApplicationEntityName    = "12";
                dicomThread.Options.DefinitionFileApplicationEntityVersion = "13";

                String sessionFullPath = Path.Combine(Paths.DataDirectoryFullPath, "Ticket1210_1.ses");

                dicomThread.Options.SaveToFile(sessionFullPath);

                this.ticket1210_1_DicomThread = new SCP();
                this.ticket1210_1_DicomThread.Initialize(threadManager);

                this.ticket1210_1_DicomThread.Options.LoadFromFile(sessionFullPath);
            }
        }
예제 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public RisEmulator()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            if (!Directory.Exists(ConfigurationsDirectory))
            {
                Directory.CreateDirectory(ConfigurationsDirectory);
            }

            this.config = Config.Deserialize(Path.Combine(ConfigurationsDirectory, "Config.xml"));
            Config.ConfigFullFileName = Path.Combine(ConfigurationsDirectory, "Config.xml");

            //
            // Initialize the browser control.
            //
            rootPath = Application.StartupPath;

            this.dvtkWebBrowserResults.XmlStyleSheetFullFileName = Path.Combine(rootPath, "DVT_RESULTS.xslt");

            if(config.TSILESupport)
                selectedTS.Add("1.2.840.10008.1.2");
            if(config.TSELESupport)
                selectedTS.Add("1.2.840.10008.1.2.1");
            if(config.TSEBESupport)
                selectedTS.Add("1.2.840.10008.1.2.2");

            //if (config.SPSDChecked)
            //    checkBoxSPSD.Checked = true;
            //else
            //    checkBoxSPSD.Checked = false;

            //
            // Set the .Net thread name for debugging purposes.
            //
            System.Threading.Thread.CurrentThread.Name = "RIS Emulator";

            //
            // Stored files options.
            //
            this.fileGroups = new FileGroups("RIS Emulator");

            this.validationResultsFileGroup = new ValidationResultsFileGroup();
            this.validationResultsFileGroup.DefaultFolder = "Results";
            this.fileGroups.Add(validationResultsFileGroup);

            this.fileGroups.CreateDirectories();

            this.fileGroups.CheckIsConfigured("\"Stored Files\\Options...\" menu item");

            //
            // The ThreadManager.
            //
            ThreadManager threadManager = new ThreadManager();

            //
            // Construct the MPPS DicomOptions implicitly by constructing a DicomThread.
            //
            SCP mppsDicomThread = new SCP();
            mppsDicomThread.Initialize(threadManager);
            this.mppsOptions = mppsDicomThread.Options;
            this.mppsOptions.LoadFromFile(Path.Combine(rootPath, "MPPS_SCP.ses"));
            this.mppsOptions.Identifier = "MPPS";
            this.mppsOptions.AttachChildsToUserInterfaces = true;
            this.mppsOptions.StorageMode = Dvtk.Sessions.StorageMode.NoStorage;
            this.mppsOptions.LogThreadStartingAndStoppingInParent = false;
            this.mppsOptions.LogWaitingForCompletionChildThreads = false;
            this.mppsOptions.ResultsDirectory = validationResultsFileGroup.Directory;

            //
            // Construct the Worklist DicomOptions implicitly by constructing a DicomThread.
            //
            worklistDicomThread = new SCP();
            worklistDicomThread.Initialize(threadManager);
            this.worklistOptions = worklistDicomThread.Options;
            this.worklistOptions.LoadFromFile(Path.Combine(rootPath, "WLM_SCP.ses"));
            this.worklistOptions.Identifier = "Worklist";
            this.worklistOptions.AttachChildsToUserInterfaces = true;
            this.worklistOptions.StorageMode = Dvtk.Sessions.StorageMode.NoStorage;
            this.worklistOptions.LogThreadStartingAndStoppingInParent = false;
            this.worklistOptions.LogWaitingForCompletionChildThreads = false;
            this.worklistOptions.ResultsDirectory = validationResultsFileGroup.Directory;

            //
            // Initialize the DicomThreadOptionsControls
            //
            this.mppsOptionsControl.DicomThreadOptions = this.mppsOptions;
            this.mppsOptionsControl.LocalAeTitleVisible = true;
            this.mppsOptionsControl.LocalPortVisible = true;
            this.mppsOptionsControl.RemoteAeTitleVisible = true;
            this.mppsOptionsControl.OptionChangedEvent+= new DicomThreadOptionsUserControl.OptionChangedEventHandler(this.HandleOptionChanged);
            this.mppsOptionsControl.UpdateUserControl();

            this.worklistOptionsControl.DicomThreadOptions = this.worklistOptions;
            this.worklistOptionsControl.LocalAeTitleVisible = true;
            this.worklistOptionsControl.LocalPortVisible = true;
            this.worklistOptionsControl.RemoteAeTitleVisible = true;
            this.worklistOptionsControl.OptionChangedEvent+= new DicomThreadOptionsUserControl.OptionChangedEventHandler(this.HandleOptionChanged);
            this.worklistOptionsControl.UpdateUserControl();

            // Save the config so next time no attempt will be made to again try to load the same settings
            this.config.Serialize();

            //
            // Set the Backward/forward button handler.
            //
            this.dvtkWebBrowserResults.BackwardFormwardEnabledStateChangeEvent+= new DvtkWebBrowserNew.BackwardFormwardEnabledStateChangeEventHandler(BackwardFormwardEnabledStateChangeEvent);

            UpdateButtons();

            //
            // Other.
            //
            this.threadsStateChangeEventHandler = new ThreadManager.ThreadsStateChangeEventHandler(this.HandleThreadsStateChangeEvent);

            // Load definition and DCM files
            dcmEditorRISEmulator.DCMFileDataDirectory = validationResultsFileGroup.Directory;
            dcmEditorRISEmulator.DefFile = this.worklistOptions.DvtkScriptSession.DefinitionManagement.DefinitionFileRootDirectory + "ModalityWorklist-FIND.def";
            dcmEditorRISEmulator.DefFile = this.worklistOptions.DvtkScriptSession.DefinitionManagement.DefinitionFileRootDirectory + "ModalityPerformedProcedureStep.def";
            dcmEditorRISEmulator.DCMFile = rootPath + @"\Data\Worklist\d1I00001.dcm";
            dataDirectory = this.worklistOptions.DataDirectory;

            //Update settings from the config XML
            if (config.DataDirectoryForEmulation != "")
                dataDirectory = config.DataDirectoryForEmulation;
            else
                config.DataDirectoryForEmulation = dataDirectory;

            buttonBrowse.Visible = false;
            textBoxDataDir.Visible = false;
            buttonStart.Enabled = false;

            dataDirectoryForTempFiles = validationResultsFileGroup.Directory;

            this.WindowState = FormWindowState.Maximized;
        }
예제 #3
0
파일: QR Emulator.cs 프로젝트: ewcasas/DVTK
        //
        // - Constructors -
        //
        /// <summary>
        /// Default constructor.
        /// </summary>
        public QREmulator()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.dvtkWebBrowserResults.ErrorWarningEnabledStateChangeEvent+=new DvtkWebBrowserNew.ErrorWarningEnabledStateChangeEventHandler(dvtkWebBrowserResults_ErrorWarningEnabledStateChangeEvent);

            if (!Directory.Exists(ConfigurationsDirectory))
            {
                Directory.CreateDirectory(ConfigurationsDirectory);
            }

            this.config = Config.Deserialize(Path.Combine(ConfigurationsDirectory, "Config.xml"));
            Config.ConfigFullFileName = Path.Combine(ConfigurationsDirectory, "Config.xml");

            //
            // Initialize browser control.
            //
            rootPath = Application.StartupPath;

            this.dvtkWebBrowserResults.XmlStyleSheetFullFileName = Path.Combine(rootPath, "DVT_RESULTS.xslt");

            dataDirectory = Path.Combine(rootPath, @"Data\QueryRetrieve\");

            //Update settings from the config XML
            if(config.DataDirectoryForEmulation != "")
                dataDirectory = config.DataDirectoryForEmulation;
            else
                config.DataDirectoryForEmulation = dataDirectory;

            checkBoxPRInfoModel.Checked = config.PatientRootInfoModelSupport;
            checkBoxSRInfoModel.Checked = config.StudyRootInfoModelSupport;
            checkBoxPSRInfoModel.Checked = config.PatientStudyRootInfoModelSupport;
            this.AE.Checked = this.config.IsCaseSensitiveAE;
            this.CS.Checked = this.config.IsCaseSensitiveCS;
            this.LO.Checked = this.config.IsCaseSensitiveLO;
            this.PN.Checked = this.config.IsCaseSensitivePN;
            this.SH.Checked = this.config.IsCaseSensitiveSH;
            if(config.TSILESupport)
                selectedTS.Add("1.2.840.10008.1.2");
            if(config.TSELESupport)
                selectedTS.Add("1.2.840.10008.1.2.1");
            if(config.TSEBESupport)
                selectedTS.Add("1.2.840.10008.1.2.2");

            //
            // Set the .Net thread name for debugging purposes.
            //
            System.Threading.Thread.CurrentThread.Name = "QR SCP Emulator";

            //
            // Stored files options.
            //
            this.fileGroups = new FileGroups("QR SCP Emulator");

            this.validationResultsFileGroup = new ValidationResultsFileGroup();
            this.validationResultsFileGroup.DefaultFolder = "Results";
            this.fileGroups.Add(validationResultsFileGroup);

            this.fileGroups.CreateDirectories();

            this.fileGroups.CheckIsConfigured("\"Stored Files\\Options...\" menu item");

            //
            // The dvtkThreadManager.
            //
            ThreadManager threadManager = new ThreadManager();

            //
            // Construct the source QR SCP.
            //
            this.sourceQRScp = new SCP();
            this.sourceQRScp.Initialize(threadManager);
            this.sourceQRScp.Options.LoadFromFile(Path.Combine(rootPath, "QR_SCP.ses"));
            this.sourceQRScp.Options.Identifier = "QR_SCP_Emulator";
            this.sourceQRScp.Options.AttachChildsToUserInterfaces = true;
            this.sourceQRScp.Options.StorageMode = Dvtk.Sessions.StorageMode.NoStorage;
            this.sourceQRScp.Options.LogThreadStartingAndStoppingInParent = false;
            this.sourceQRScp.Options.LogWaitingForCompletionChildThreads = false;
            this.sourceQRScp.Options.ResultsDirectory = validationResultsFileGroup.Directory;
            this.sourceQRScp.Options.DataDirectory = validationResultsFileGroup.Directory;
            this.socketTimeout.Value = this.sourceQRScp.Options.SocketTimeout;
            //
            //Initialize move destinations
            //
            aeRegistrationControl1.Initialize(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\DVtk\\QR SCP Emulator\\Configurations\\MoveDestinations.xml",
                sourceQRScp.Options);
            aeRegistrationControl1.OnShowEchoResults += new AERegistrationControl.ShowEchoResults(ShowMoveDestinationResults);

            //
            // Initialize the DicomThreadOptionsControls
            //
            this.dicomThreadOptionsUserControl.DicomThreadOptions = this.sourceQRScp.Options;
            this.dicomThreadOptionsUserControl.LocalAeTitleVisible = true;
            this.dicomThreadOptionsUserControl.LocalPortVisible = true;
            this.dicomThreadOptionsUserControl.LocalAETitleName = "Local AE title\n(QR SCP&& Store SCU)";
            this.dicomThreadOptionsUserControl.RemoteAeTitleLabel = "QR SCU AE Title:";
            this.dicomThreadOptionsUserControl.RemotePortLabel = "Move destination Port:";
            this.dicomThreadOptionsUserControl.RemoteIpAddressLabel = "Move destination IP Addr:";
            this.dicomThreadOptionsUserControl.RemoteAeTitleVisible = true;
            this.dicomThreadOptionsUserControl.RemoteIpAddressVisible = false;
            this.dicomThreadOptionsUserControl.RemotePortVisible = false;
            this.dicomThreadOptionsUserControl.OptionChangedEvent+= new DicomThreadOptionsUserControl.OptionChangedEventHandler(this.HandleOptionChanged);
            this.dicomThreadOptionsUserControl.UpdateUserControl();

            // Save the config so next time no attempt will be made to again try to load the same settings
            this.config.Serialize();

            //
            // Set the Backward/forward button handler.
            //
            this.dvtkWebBrowserResults.BackwardFormwardEnabledStateChangeEvent += new DvtkApplicationLayer.UserInterfaces.DvtkWebBrowserNew.BackwardFormwardEnabledStateChangeEventHandler(BackwardFormwardEnabledStateChangeEvent);
            UpdateButtons();

            this.threadsStateChangeEventHandler = new ThreadManager.ThreadsStateChangeEventHandler(this.HandleThreadsStateChangeEvent);

            // Load definition and DCM files
            dcmEditorQREmulator.DCMFileDataDirectory = validationResultsFileGroup.Directory;
            dcmEditorQREmulator.DefFile = sourceQRScp.Options.DvtkScriptSession.DefinitionManagement.DefinitionFileRootDirectory + "PatientRootQueryRetrieve-FIND.def";
            dcmEditorQREmulator.DCMFile = rootPath + @"\Data\QueryRetrieve\d1I00001.dcm";

            buttonBrowse.Visible = false;
            textBoxDataDir.Visible = false;

            dataDirectoryForTempFiles = validationResultsFileGroup.Directory;

            this.WindowState = FormWindowState.Maximized;
        }
예제 #4
0
        //
        // - Test methods -
        //
        private void Ticket1210_1()
        {
            if (this.ticket1210_1_DicomThread == null)
            {
                ThreadManager threadManager = new ThreadManager();
                SCP dicomThread = new SCP();
                dicomThread.Initialize(threadManager);

                dicomThread.Options.LocalAeTitle = "1";
                dicomThread.Options.LocalImplementationClassUid = "2";
                dicomThread.Options.LocalImplementationVersionName = "3";
                dicomThread.Options.LocalMaximumLength = 4;
                dicomThread.Options.LocalPort = 5;
                dicomThread.Options.RemoteAeTitle = "6";
                dicomThread.Options.RemoteHostName = "7";
                dicomThread.Options.RemoteImplementationClassUid = "8";
                dicomThread.Options.RemoteImplementationVersionName = "9";
                dicomThread.Options.RemoteMaximumLength = 10;
                dicomThread.Options.RemotePort = 11;
                dicomThread.Options.DefinitionFileApplicationEntityName = "12";
                dicomThread.Options.DefinitionFileApplicationEntityVersion = "13";

                String sessionFullPath = Path.Combine(Paths.DataDirectoryFullPath, "Ticket1210_1.ses");

                dicomThread.Options.SaveToFile(sessionFullPath);

                this.ticket1210_1_DicomThread = new SCP();
                this.ticket1210_1_DicomThread.Initialize(threadManager);

                this.ticket1210_1_DicomThread.Options.LoadFromFile(sessionFullPath);
            }
        }