Ejemplo n.º 1
0
        public override void ApplyConfig(DicomConfig config)
        {
            // set up the Modality Worklist information models
            ModalityWorklistInformationModel modalityWorklistInformationModel = new ModalityWorklistInformationModel();

            // load the information models
            modalityWorklistInformationModel.LoadInformationModel(config.DataDirectory);

            // add any default attribute values to the information models
            modalityWorklistInformationModel.AddDefaultAttributeToInformationModel("0x00400001", DvtkData.Dimse.VR.AE, config.SutAeTitle);
            modalityWorklistInformationModel.AddDefaultAttributeToInformationModel("0x00400002", DvtkData.Dimse.VR.DA, System.DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture));
            modalityWorklistInformationModel.AddDefaultAttributeToInformationModel("0x00400002", DvtkData.Dimse.VR.TM, System.DateTime.Now.ToString("HHmmss", System.Globalization.CultureInfo.InvariantCulture));

            // add any additional attribute values to the information models
            //			modalityWorklistInformationModel.AddAdditionalAttributeToInformationModel("0x00080054", DvtkData.Dimse.VR.AE, config.DvtAeTitle);


            // set up the worklist SCP
            WorklistScp worklistScp = new WorklistScp();

            Scp = worklistScp;

            // apply the remaining configuration
            base.ApplyConfig(config);

            // add the default message handlers with the information model
            worklistScp.AddDefaultMessageHandlers(modalityWorklistInformationModel);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Apply the Dicom Configuration to the Client,
        /// </summary>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="config">Dicom Configuration.</param>
        public override void ApplyConfig(CommonConfig commonConfig, DicomPeerToPeerConfig config)
        {
            // set up the worklist SCP
            WorklistScp worklistScp = new WorklistScp();

            // update supported transfer syntaxes here
            //worklistScp.ClearTransferSyntaxes();
            //worklistScp.AddTransferSyntax(HliScp.IMPLICIT_VR_LITTLE_ENDIAN);

            // Save the SCP and apply the configuration
            Scp = worklistScp;
            base.ApplyConfig(commonConfig, config);

            // set up the Modality Worklist information models
            _modalityWorklistInformationModel = new ModalityWorklistInformationModel();

            // load the information models
            _modalityWorklistInformationModel.LoadInformationModel(RootedBaseDirectory.GetFullPathname(commonConfig.RootedBaseDirectory, config.SourceDataDirectory));

            // add any default attribute values to the information models
            bool overWriteExistingValue = true;

            _modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(overWriteExistingValue, "0x00400001", VR.AE, config.FromActorAeTitle);
            _modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(overWriteExistingValue, "0x00400002", VR.DA, System.DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture));
            _modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(overWriteExistingValue, "0x00400003", VR.TM, System.DateTime.Now.ToString("HHmmss", System.Globalization.CultureInfo.InvariantCulture));

            // add any additional attribute values to the information models
            //modalityWorklistInformationModel.AddAdditionalAttributeToInformationModel(overWriteExistingValue, "0x00080054", VR.AE, config.DvtAeTitle);

            // add the default message handlers with the information model
            worklistScp.AddDefaultMessageHandlers(_modalityWorklistInformationModel);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Add the default message handlers - include the Information Model that should be used.
 /// </summary>
 /// <param name="modalityWorklistInformationModel">Modality Worklist Information Model.</param>
 public void AddDefaultMessageHandlers(ModalityWorklistInformationModel modalityWorklistInformationModel)
 {
     // add the CFindHandler with the Information Models
     AddToBack(new CFindHandler(modalityWorklistInformationModel));
 }
Ejemplo n.º 4
0
        protected override void Execute()
        {
            //
            // The Worklist message handler.
            //
            MessageHandlerSendRandomCFindRsp wlHandler = null;

            Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler worklistCFindHandler = null;

            if (sendRandomizeRsps)
            {
                ModalityWorklistInformationModel modalityWorklistInformationModel = RisEmulator.CreateMWLInformationModel(true, worklistThread);
                worklistCFindHandler = new Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler(modalityWorklistInformationModel);
            }
            else
            {
                wlHandler = new MessageHandlerSendRandomCFindRsp();
                RandomizeDatasets();
                wlHandler.setRandomDatasets(randomizedDatasets);
            }

            //
            // The MPPS message handlers.
            //
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler mppsNCreateHandler = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler();
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler    mppsNSetHandler    = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler();
            MessageHandlerShowMPPSStatus messageHandlerShowMPPSStatus = new MessageHandlerShowMPPSStatus();

            //
            // Create the actual SCP's
            //
            if (this.mppsOptions.LocalPort == this.worklistOptions.LocalPort)
            {
                WriteWarning("Worklist SCP and MPPS are configured to listen to the same port. Only one DicomThread is started using the settings from the Worklist SCP");

                RISScp worklistMppsScp = new RISScp("Worklist_MPPS_SCP");
                worklistMppsScp.Initialize(this);
                worklistMppsScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistMppsScp.Options.Identifier = "Worklist_MPPS_SCP";
                worklistMppsScp.setSupportedTS(selectedTSList);

                if (sendRandomizeRsps)
                {
                    worklistMppsScp.AddToFront(worklistCFindHandler);
                }
                else
                {
                    worklistMppsScp.AddToFront(wlHandler);
                }

                worklistMppsScp.AddToFront(messageHandlerShowMPPSStatus);
                worklistMppsScp.AddToFront(mppsNCreateHandler);
                worklistMppsScp.AddToFront(mppsNSetHandler);

                worklistMppsScp.Start();
            }
            else
            {
                RISScp mppsScp = new RISScp("MPPS_SCP");
                mppsScp.Initialize(this);
                mppsScp.Options.DeepCopyFrom(this.mppsOptions);
                mppsScp.Options.Identifier = "MPPS_SCP";
                mppsScp.setSupportedTS(selectedTSList);

                RISScp worklistScp = new RISScp("Worklist_SCP");
                worklistScp.Initialize(this);
                worklistScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistScp.Options.Identifier = "Worklist_SCP";
                //worklistScp.setSupportedTS(selectedTSList);

                // Add the message handlers.
                if (sendRandomizeRsps)
                {
                    worklistScp.AddToFront(worklistCFindHandler);
                }
                else
                {
                    worklistScp.AddToFront(wlHandler);
                }

                mppsScp.AddToFront(messageHandlerShowMPPSStatus);
                mppsScp.AddToFront(mppsNCreateHandler);
                mppsScp.AddToFront(mppsNSetHandler);

                worklistScp.Start();
                mppsScp.Start();
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Class Constructor
 /// </summary>
 public CFindHandler(ModalityWorklistInformationModel modalityWorklistInformationModel)
 {
     _modalityWorklistInformationModel = modalityWorklistInformationModel;
 }