Example #1
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);
        }
        public void TestFixtureSetUp()
        {
            Dvtk.Setup.Initialize();

            modalityWorklistInformationModel = new ModalityWorklistInformationModel();
            modalityWorklistInformationModel.DataDirectory = Paths.ResultsDirectoryFullPath;

            String dataDirectoryFullName = Path.Combine(Paths.DataDirectoryFullPath, "Ticket1152");
            DirectoryInfo directoryInfo = new DirectoryInfo(dataDirectoryFullName);

            FileInfo[] fileInfos = directoryInfo.GetFiles();

            if (fileInfos.Length != 0)
            {
                foreach (FileInfo fileInfo in fileInfos)
                {
                    DataSet dataSet = new DataSet();

                    dataSet.Read(fileInfo.FullName);

                    modalityWorklistInformationModel.AddToInformationModel(dataSet);
                }
            }
        }
Example #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));
 }
Example #4
0
 /// <summary>
 /// Class Constructor
 /// </summary>
 public CFindHandler(ModalityWorklistInformationModel modalityWorklistInformationModel)
 {
     _modalityWorklistInformationModel = modalityWorklistInformationModel;
 }
        public void TestFixtureTearDown()
        {
            if (modalityWorklistInformationModel != null)
                modalityWorklistInformationModel = null;

            Dvtk.Setup.Terminate();
        }
Example #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="scuAeTitle"></param>
        /// <param name="randomizeFirst"></param>
        /// <returns></returns>
        public static ModalityWorklistInformationModel CreateMWLInformationModel(bool randomizeFirst, DicomThread dicomThread)
        {
            dicomThread.WriteInformation(string.Format("Creating the MWL information model based on data directory : {0}", dataDirectory));
            ModalityWorklistInformationModel modalityWorklistInformationModel = new ModalityWorklistInformationModel();

            //Specify directory for temp DCM files
            modalityWorklistInformationModel.DataDirectory = dataDirectoryForTempFiles;

            DirectoryInfo directoryInfo = new DirectoryInfo(dataDirectory);

            FileInfo[] fileInfos = directoryInfo.GetFiles();

            if (fileInfos.Length != 0)
            {
                foreach (FileInfo fileInfo in fileInfos)
                {
                    try
                    {
                        DataSet dataSet = new DataSet();

                        dataSet.Read(fileInfo.FullName);

                        if (randomizeFirst)
                        {
                            dataSet.Randomize("@");
                        }

                        modalityWorklistInformationModel.AddToInformationModel(dataSet);
                    }
                    catch (Exception )
                    {
                        string theErrorText = string.Format("Invalid DICOM File - {0} will be skiped from MWL information model.\n\n", fileInfo.FullName);
                        dicomThread.WriteInformation(theErrorText);
                    }
                }
            }

            if (isCurrentSPSD)
            {

                //modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(true, "0x00400001", DvtkData.Dimse.VR.AE, scuAeTitle);
                modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(true, "0x00400100[1]/0x00400002", DvtkData.Dimse.VR.DA, System.DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture));
                modalityWorklistInformationModel.AddDefaultAttributeToInformationModel(true, "0x00400100[1]/0x00400003", DvtkData.Dimse.VR.TM, System.DateTime.Now.ToString("HHmmss", System.Globalization.CultureInfo.InvariantCulture));
            }

            return (modalityWorklistInformationModel);
        }