• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Messages.DicomMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DvtkHighLevelInterface.Dicom.Messages.DicomMessage的典型用法代码示例。如果您正苦于以下问题:C# DicomMessage类的具体用法?C# DicomMessage怎么用?C# DicomMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DicomMessage类属于DvtkHighLevelInterface.Dicom.Messages命名空间,在下文中一共展示了DicomMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DicomTriggerItem

 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="message">DICOM Message to be triggered.</param>
 /// <param name="sopClassUid">SOP Class UID of DICOM Message.</param>
 /// <param name="transferSyntaxes">Transfer Syntaxes of DICOM Message</param>
 public DicomTriggerItem(DicomMessage message, System.String sopClassUid, System.String[] transferSyntaxes)
 {
     _message = message;
     _sopClassUid = sopClassUid;
     _transferSyntaxes = new System.String[transferSyntaxes.Length];
     _transferSyntaxes = transferSyntaxes;
 }
开发者ID:ewcasas,项目名称:DVTK,代码行数:13,代码来源:DicomTriggerItem.cs


示例2: HandleNActionRequest

        /// <summary>
        /// Overridden N-ACTION-RQ message handler. Return an N-EVENT-REPORT-RQ
        /// after the N-ACTION-RSP.
        /// </summary>
        /// <param name="dicomMessage">N-ACTION-RQ and Dataset.</param>
        /// <returns>Boolean - true if dicomMessage handled here.</returns>
        public override bool HandleNActionRequest(DicomMessage dicomMessage)
        {
            // Validate the received message
            //            System.String iodName = DicomThread.GetIodNameFromDefinition(dicomMessage);
            //            DicomThread.Validate(dicomMessage, iodName);

            // set up the default N-ACTION-RSP with a successful status
            DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.NACTIONRSP);
            responseMessage.Set("0x00000900", VR.US, 0);

            // send the response
            this.Send(responseMessage);

            // delay before generating the N-EVENT-REPORT-RQ
            System.Threading.Thread.Sleep(_eventDelay);

            // create the N-EVENT-REPORT-RQ based in the contents of the N-ACTION-RQ
            DicomMessage requestMessage = GenerateTriggers.MakeStorageCommitEvent(_informationModels, dicomMessage);

            // send the request
            this.Send(requestMessage);

            // message handled
            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:31,代码来源:NActionNEventReportHandler.cs


示例3: TriggerSendAssociation

        /// <summary>
        /// Triggers sending of an association.
        /// </summary>
        /// <param name="dicomMessage">The DICOM message to send.</param>
        /// <param name="presentationContexts">The presentation contexts to use for setting up the DICOM association.</param>
        public void TriggerSendAssociation(DicomMessage dicomMessage, params PresentationContext[] presentationContexts)
        {
            DicomMessageCollection dicomMessageCollection = new DicomMessageCollection();
            dicomMessageCollection.Add(dicomMessage);

            SendAssociationTrigger sendAssociationTrigger = new SendAssociationTrigger(dicomMessageCollection, presentationContexts);

            Trigger(sendAssociationTrigger);
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:14,代码来源:SCU.cs


示例4: CreateValidCEchoRq

        public static DicomMessage CreateValidCEchoRq()
        {
            DicomMessage dicomMessage = new DicomMessage(DimseCommand.CECHORQ);

            dicomMessage.CommandSet.Set("0x00000000", VR.UL, 10); // "Group length", set to incorrect value.
            dicomMessage.CommandSet.Set("0x00000002", VR.UI, "1.2.840.10008.1.1"); // "Affected SOP Class UID"
            dicomMessage.CommandSet.Set("0x00000110", VR.US, 100); // "Message ID"
            dicomMessage.CommandSet.Set("0x00000800", VR.US, 0x101); // "Data Set Type"

            return (dicomMessage);
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:11,代码来源:DicomMessage_NUnit.cs


示例5: InitializeDicomComparator

        /// <summary>
        /// Initializes the encapsulated Dvtk.Comparator.DicomComparator class with the supplied DICOM message.
        /// </summary>
        /// <param name="dicomMessage">The DICOM message.</param>
        /// <returns>The encapsulated Dvtk.Comparator.DicomComparator instance.</returns>
        public DicomComparator InitializeDicomComparator(DicomMessage dicomMessage)
        {
            _hl7Comparator = null;

            bool initialized = _dicomComparator.Initialize(dicomMessage.DvtkDataDicomMessage);
            if (initialized == false)
            {
                _dicomComparator = null;
            }

            return _dicomComparator;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:17,代码来源:Comparator.cs


示例6: DicomMessageCollection

        /// <summary>
        /// Constructor with initialization. Shallow copy.
        /// </summary>
        /// <param name="arrayOfValues">values to copy.</param>
        public DicomMessageCollection(DicomMessage[] arrayOfValues)
        {
            if (arrayOfValues == null)
            {
                throw new ArgumentNullException();
            }

            foreach (DicomMessage value in arrayOfValues)
            {
                this.Add(value);
            }
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:16,代码来源:DicomMessageCollection.cs


示例7: TriggerSendAssociationAndWait

        /// <summary>
        /// Trigger a send association and wait until it has been completed.
        /// </summary>
        /// <param name="dicomMessage">The DICOM message to send.</param>
        /// <param name="presentationContexts">The presentation contexts to propose.</param>
        /// <returns>
        /// True indicates the other side has accepted the association, false indicates the other side
        /// has rejected the association.
        /// </returns>
        public bool TriggerSendAssociationAndWait(DicomMessage dicomMessage, params PresentationContext[] presentationContexts)
        {
            DicomMessageCollection dicomMessageCollection = new DicomMessageCollection();
            dicomMessageCollection.Add(dicomMessage);

            SendAssociationTrigger sendAssociationTrigger = new SendAssociationTrigger(dicomMessageCollection, presentationContexts);

            Trigger(sendAssociationTrigger);

            WaitForLastTriggerCallProcessed();

            return(sendAssociationTrigger.returnValue);
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:22,代码来源:SCU.cs


示例8: HandleCGetRequest

        public override bool HandleCGetRequest(DicomMessage dicomMessage)
        {
            // Validate the received message
            //System.String iodName = DicomThread.GetIodNameFromDefinition(dicomMessage);
            //DicomThread.Validate(dicomMessage, iodName);

            // Storage suboperations should be sent over the same association as the CGET.
            // The CGET SCU becomes a Storage SCP for the duration of the storage suboperations.
            // The CGET SCU should ensure that all the necessary storage SOP Classes are negotiated
            // during association establishment.

            DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.CGETRSP);
            this.Send(responseMessage);
            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:15,代码来源:CGetHandler.cs


示例9: CreateValidPatientRootQueryRetrieveCFindRq

        public static DicomMessage CreateValidPatientRootQueryRetrieveCFindRq()
        {
            DicomMessage dicomMessage = new DicomMessage(DimseCommand.CFINDRQ);

            dicomMessage.CommandSet.Set("0x00000000", VR.UL, 10); // "Group length", set to incorrect value.
            dicomMessage.CommandSet.Set("0x00000002", VR.UI, "1.2.840.10008.5.1.4.1.2.1.1"); // "Affected SOP Class UID"
            dicomMessage.CommandSet.Set("0x00000110", VR.US, 100); // "Message ID"
            dicomMessage.CommandSet.Set("0x00000700", VR.US, 0); // "Priority"
            dicomMessage.CommandSet.Set("0x00000800", VR.US, 0); // "Data Set Type"

            dicomMessage.DataSet.Set("0x00080052", VR.CS, "PATIENT"); // "Query Retrieve Level"
            dicomMessage.DataSet.Set("0x00100020", VR.LO); // "Patient ID."

            return (dicomMessage);
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:15,代码来源:DicomMessage_NUnit.cs


示例10: HandleNActionRequest

        /// <summary>
        /// Overridden N-ACTION-RQ message handler.
        /// </summary>
        /// <param name="dicomMessage">N-ACTION-RQ and Dataset.</param>
        /// <returns>Boolean - true if dicomMessage handled here.</returns>
        public override bool HandleNActionRequest(DicomMessage dicomMessage)
        {
            // Validate the received message
            //			System.String iodName = DicomThread.GetIodNameFromDefinition(dicomMessage);
            //			DicomThread.Validate(dicomMessage, iodName);

            // set up the default N-ACTION-RSP with a successful status
            DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.NACTIONRSP);
            responseMessage.Set("0x00000900", VR.US, 0);

            // send the response
            this.Send(responseMessage);

            // message handled
            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:21,代码来源:NActionHandler.cs


示例11: HandleNSetRequest

        public override bool HandleNSetRequest(DicomMessage dicomMessage)
        {
            // Try to get the IOD Name
            System.String iodName = DicomThread.GetIodNameFromDefinition(dicomMessage);

            System.String messsage = String.Format("Processed N-SET-RQ {0}", iodName);
            WriteInformation(messsage);

            DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.NSETRSP);

            responseMessage.Set("0x00000900", VR.US, 0);

            this.Send(responseMessage);

            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:16,代码来源:NSetHandler.cs


示例12: HandleCFindRequest

        /// <summary>
        /// Overridden C-FIND-RQ message handler that makes use of the appropriate Information Model to handle the query.
        /// </summary>
        /// <param name="queryMessage">C-FIND-RQ Identifier (Dataset) containing query attributes.</param>
        /// <returns>Boolean - true if dicomMessage handled here.</returns>
        public override bool HandleCFindRequest(DicomMessage queryMessage)
        {
            // Validate the received message
            //System.String iodName = DicomThread.GetIodNameFromDefinition(queryMessage);
            //DicomThread.Validate(queryMessage, iodName);

            // perform query
            DicomMessageCollection responseMessages = _modalityWorklistInformationModel.QueryInformationModel(queryMessage);

            if(responseMessages.Count > 1)
            {
                WriteInformation(string.Format("Sending {0} C-FIND responses after performing query.\r\n",responseMessages.Count));
            }
            else
            {
                WriteWarning("No response from MWL information model after performing query.\r\n");
            }

            // handle responses
            foreach (DicomMessage responseMessage in responseMessages)
            {
                int waitedTime = 0;

                // Check for cancel message from SCU
                if (WaitForPendingDataInNetworkInputBuffer(100, ref waitedTime))
                {
                    DicomMessage cancelRq = ReceiveDicomMessage();

                    if (cancelRq.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.CCANCELRQ)
                    {
                        // set up the C-FIND-RSP with cancel status
                        DicomMessage respMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.CFINDRSP);
                        respMessage.Set("0x00000900", DvtkData.Dimse.VR.US, 0xFE00);

                        // send the response
                        this.Send(respMessage);
                        break;
                    }
                }

                this.Send(responseMessage);
            }

            // message handled
            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:51,代码来源:CFindHandler.cs


示例13: HandleNCreateRequest

        public override bool HandleNCreateRequest(DicomMessage dicomMessage)
        {
            // Try to get the IOD Name
            System.String iodName = DicomThread.GetIodNameFromDefinition(dicomMessage);

            // Try to get the Patient Name
            DvtkHighLevelInterface.Dicom.Other.Values attributeValues = dicomMessage["0x00100010"].Values;
            System.String patientName = attributeValues[0];
            System.String messsage = String.Format("Processed N-CREATE-RQ {0}: \"{1}\"", iodName, patientName);
            WriteInformation(messsage);

            DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.NCREATERSP);

            responseMessage.Set("0x00000900", VR.US, 0);

            this.Send(responseMessage);
            return true;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:18,代码来源:NCreateHandler.cs


示例14: AfterHandlingCEchoRequest

        /// <summary>
        /// Method to handle the workflow after receiving a C-EHO-RQ.
        /// </summary>
        /// <param name="dicomMessage">C-ECHO-RQ message.</param>
        protected override void AfterHandlingCEchoRequest(DicomMessage dicomMessage)
        {
            if (IsMessageHandled == false)
            {
                DicomMessage dicomMessageToSend = new DicomMessage(DvtkData.Dimse.DimseCommand.CECHORSP);

                dicomMessageToSend.Set("0x00000002", DvtkData.Dimse.VR.UI, "1.2.840.10008.1.1");
                dicomMessageToSend.Set("0x00000900", DvtkData.Dimse.VR.US, 0);

                Send(dicomMessageToSend);

                // message has now been handled
                IsMessageHandled = true;
            }
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:19,代码来源:OverviewThread.cs


示例15: Execute

        protected override void Execute()
        {
            PresentationContext presentationContext = new PresentationContext("1.2.840.10008.1.20.1", // Abstract Syntax Name
                                                                            "1.2.840.10008.1.2"); // Transfer Syntax Name(s)
            PresentationContext[] presentationContexts = new PresentationContext[1];
            presentationContexts[0] = presentationContext;

            SendAssociateRq(presentationContexts);

            ReceiveAssociateAc();

            if (_nActionMessage != null)
            {
                WriteInformation("N-Action Request Information"+"\n"+_nActionMessage.DataSet.Dump(""));
                Send(_nActionMessage);
            }

            ReceiveDicomMessage();

            if (_Delay < 0)
            {
                // Async storage commitment
                SendReleaseRq();

                ReceiveReleaseRp();

                // Start the Storage commit SCP for receiving N-EVENTREPORT
                EmulateStorageCommitSCP();
            }
            else
            {
                string info;
                if (_Delay == 0)
                {
                    //Wait for 24 hrs(infinite)
                    int waitingTime = 24 * 60 * 60;
                    _Delay = (short)waitingTime;
                    info = "Waiting forever for N-Event-Report.";
                }
                else
                {
                    info = string.Format("Waiting for N-Event-Report for {0} secs", _Delay);
                }
                WriteInformation(info);

                int waitedTime = 0;
                if (WaitForPendingDataInNetworkInputBuffer(_Delay * 1000, ref waitedTime))
                {
                    DicomMessage nEventReportResponse = ReceiveDicomMessage();

                    if (nEventReportResponse.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.NEVENTREPORTRQ)
                    {
                        // set up the default N-EVENT-REPORT-RSP with a successful status
                        DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.NEVENTREPORTRSP);
                        responseMessage.Set("0x00000900", DvtkData.Dimse.VR.US, 0);

                        // send the response
                        this.Send(responseMessage);

                        string msg = "N-Event-Report is received from PACS.";
                        WriteInformation(msg);
                        WriteInformation("N-Event-Report Information\n"+nEventReportResponse.DataSet.Dump(""));

                        SendReleaseRq();

                        ReceiveReleaseRp();

                        return;
                    }
                }
                else
                {
                    SendReleaseRq();

                    ReceiveReleaseRp();

                    // Start the Storage commit SCP for receiving N-EVENTREPORT
                    EmulateStorageCommitSCP();
                }
            }
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:81,代码来源:OverviewThread.cs


示例16: RetrieveInformationModel

 /// <summary>
 /// Retrieve data from the Information Model using the given retrieve message.
 /// </summary>
 /// <param name="retrieveMessage">Message used to retrieve the Information Model.</param>
 /// <returns>File list - containing the filenames of all instances matching the retrieve dataset attributes.</returns>
 public DvtkData.Collections.StringCollection RetrieveInformationModel(DicomMessage retrieveMessage)
 {
     PatientStudyOnlyInformationModel root = (PatientStudyOnlyInformationModel)Root;
     return root.RetrieveInformationModel(retrieveMessage.DataSet.DvtkDataDataSet);
 }
开发者ID:ewcasas,项目名称:DVTK,代码行数:10,代码来源:QueryRetrievePatientStudyOnlyInformationModel.cs


示例17: GenerateTrigger

        private DicomTrigger GenerateTrigger(DicomMessage dicomMessage)
        {
            DicomTrigger storageCommitTrigger = new DicomTrigger(TransactionNameEnum.RAD_10);
            storageCommitTrigger.AddItem(GenerateTriggers.MakeStorageCommitEvent(_informationModels, dicomMessage),
                                        "1.2.840.10008.1.20.1",
                                        "1.2.840.10008.1.2");

            return storageCommitTrigger;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:9,代码来源:DicomStorageCommitServer.cs


示例18: IndexOf

 /// <summary>
 /// Determines the index of a specific item in the <see cref="System.Collections.IList"/>.
 /// </summary>
 /// <param name="value">The item to locate in the <see cref="System.Collections.IList"/>.</param>
 /// <returns>The index of <c>value</c> if found in the list; otherwise, -1.</returns>
 public int IndexOf(DicomMessage value)
 {
     return base.IndexOf(value);
 }
开发者ID:ewcasas,项目名称:DVTK,代码行数:9,代码来源:DicomMessageCollection.cs


示例19: Apply

 /// <summary>
 /// Override to implement how to change an outbound DICOM message.
 /// </summary>
 /// <param name="dicomMessage">The outbound DICOM message.</param>
 public abstract void Apply(DicomMessage dicomMessage);
开发者ID:ewcasas,项目名称:DVTK,代码行数:5,代码来源:OutboundDicomMessageFilter.cs


示例20: HandleCMoveRequest

        public override bool HandleCMoveRequest(DicomMessage retrieveMessage)
        {
            // try to get the SOP Class Uid so that we know which Information Model to use.
            DvtkHighLevelInterface.Dicom.Other.Values values = retrieveMessage.CommandSet["0x00000002"].Values;
            System.String sopClassUid = values[0];
            DvtkData.Dul.AbstractSyntax abstractSyntax = new DvtkData.Dul.AbstractSyntax(sopClassUid);

            // try to get the Move Destination AE.
            values = retrieveMessage.CommandSet["0x00000600"].Values;
            string vr = retrieveMessage.CommandSet["0x00000600"].VR.ToString();
            System.String moveDestinationAE = values[0];
            string hexString = moveDestinationAE;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            if (DicomThread.Options.LoadedDefinitionFileNames.Length < 10)
                WriteWarning("Some of the definition files is not loaded properly.");
            if (vr == "UN")
            {
                for (int i = 0; i <= hexString.Length - 2; i += 2)
                {
                    sb.Append(Convert.ToString(Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber))));
                }
            }
            else if (vr == "AE")
            {
                sb.Append(moveDestinationAE);
            }
            if (moveDestinationAE == null || moveDestinationAE=="")
            {
                DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.CMOVERSP);
                responseMessage.Set("0x00000900", VR.US, 0xA801);
                responseMessage.Set("0x00000902", VR.LO, "Unknown Move Destination");
                this.Send(responseMessage);
                return(true);
            }
            MoveAEdetailsIndex=FindMoveAEDetails(sb.ToString());
            if (IsHaveMoveDestinations && MoveAEdetailsIndex == -1)
            {
                DicomMessage responseMessage = new DicomMessage(DvtkData.Dimse.DimseCommand.CMOVERSP);
                responseMessage.Set("0x00000900", VR.US, 0xA801);
                responseMessage.Set("0x00000902", VR.LO, "Move Destination not registered in SCP");
                this.Send(responseMessage);
                WriteWarning("Move destination is not registered in SCP");
                return (true);
            }
            DvtkData.Collections.StringCollection retrieveList = null;

            // check if we should use the Patient Root Information Model
            if ((abstractSyntax.UID == DvtkData.Dul.AbstractSyntax.Patient_Root_Query_Retrieve_Information_Model_MOVE.UID) &&
                (PatientRootInformationModel != null))
            {
                // check if the information model should be refreshed before retrieving
                if (RefreshInformationModelBeforeUse == true)
                {
                    PatientRootInformationModel.RefreshInformationModel();
                }

                // perform retrieve
                retrieveList = PatientRootInformationModel.RetrieveInformationModel(retrieveMessage);
            }
                // check if we should use the Study Root Information Model
            else if ((abstractSyntax.UID == DvtkData.Dul.AbstractSyntax.Study_Root_Query_Retrieve_Information_Model_MOVE.UID) &&
                (StudyRootInformationModel != null))
            {
                // check if the information model should be refreshed before retrieving
                if (RefreshInformationModelBeforeUse == true)
                {
                    StudyRootInformationModel.RefreshInformationModel();
                }

                // perform retrieve
                retrieveList = StudyRootInformationModel.RetrieveInformationModel(retrieveMessage);
            }
                // check if we should use the Patient Study Only Information Model
            else if ((abstractSyntax.UID == DvtkData.Dul.AbstractSyntax.Patient_Study_Only_Query_Retrieve_Information_Model_MOVE.UID) &&
                (PatientStudyOnlyInformationModel != null))
            {
                // check if the information model should be refreshed before retrieving
                if (RefreshInformationModelBeforeUse == true)
                {
                    PatientStudyOnlyInformationModel.RefreshInformationModel();
                }

                // perform retrieve
                retrieveList = PatientStudyOnlyInformationModel.RetrieveInformationModel(retrieveMessage);
            }

            // process the retrieve list
            return ProcessRetrieveList(moveDestinationAE, retrieveList);
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:89,代码来源:CMoveHandler.cs



注:本文中的DvtkHighLevelInterface.Dicom.Messages.DicomMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DwarfCorp.DwarfTime类代码示例发布时间:2022-05-24
下一篇:
C# RESTMethods.RequestInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap