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

C# Network.DcmCommand类代码示例

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

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



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

示例1: SendNSetResponse

 protected void SendNSetResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
     DcmDataset dataset, DcmStatus status)
 {
     DcmCommand command = new DcmCommand();
     command.AffectedSOPClassUID = affectedClass;
     command.CommandField = DcmCommandField.NSetResponse;
     command.MessageIDBeingRespondedTo = messageIdRespondedTo;
     command.HasDataset = (dataset != null);
     command.Status = status;
     command.AffectedSOPInstanceUID = affectedInstance;
     Log.Info("{0} -> N-Set response [id: {1}; class: {2}]: {3}", LogID, messageIdRespondedTo, affectedClass.Description, status);
     SendDimse(presentationID, command, dataset);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:13,代码来源:DcmNetworkBase.cs


示例2: SendNGetRequest

 protected void SendNGetRequest(byte presentationID, ushort messageID, DicomUID requestedClass, DicomUID requestedInstance, DicomTag[] attributes)
 {
     DcmCommand command = new DcmCommand();
     command.RequestedSOPClassUID = requestedClass;
     command.CommandField = DcmCommandField.NGetRequest;
     command.MessageID = messageID;
     command.HasDataset = false;
     command.RequestedSOPInstanceUID = requestedInstance;
     command.AttributeIdentifierList = new DcmAttributeTag(DicomTags.AttributeIdentifierList);
     command.AttributeIdentifierList.SetValues(attributes);
     Log.Info("{0} -> N-Get request [pc: {1}; id: {2}; class: {3}]", LogID, presentationID, messageID, requestedClass.Description);
     SendDimse(presentationID, command, null);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:13,代码来源:DcmNetworkBase.cs


示例3: SendNSetRequest

 protected void SendNSetRequest(byte presentationID, ushort messageID, DicomUID requestedClass, DicomUID requestedInstance, DcmDataset dataset)
 {
     DcmCommand command = new DcmCommand();
     command.RequestedSOPClassUID = requestedClass;
     command.CommandField = DcmCommandField.NSetRequest;
     command.MessageID = messageID;
     command.HasDataset = (dataset != null);
     command.RequestedSOPInstanceUID = requestedInstance;
     Log.Info("{0} -> N-Set request [pc: {1}; id: {2}; class: {3}]", LogID, presentationID, messageID, requestedClass.Description);
     SendDimse(presentationID, command, dataset);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:11,代码来源:DcmNetworkBase.cs


示例4: SendNActionRequest

 protected void SendNActionRequest(byte presentationID, ushort messageID, DicomUID requestedClass, DicomUID requestedInstance, 
     ushort actionTypeID, DcmDataset dataset)
 {
     DcmCommand command = new DcmCommand();
     command.RequestedSOPClassUID = requestedClass;
     command.CommandField = DcmCommandField.NActionRequest;
     command.MessageID = messageID;
     command.HasDataset = (dataset != null);
     command.RequestedSOPInstanceUID = requestedInstance;
     command.ActionTypeID = actionTypeID;
     Log.Info("{0} -> N-Action request [pc: {1}; id: {2}; class: {3}; action: {4:x4}]",
         LogID, presentationID, messageID, requestedClass, actionTypeID);
     SendDimse(presentationID, command, dataset);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:14,代码来源:DcmNetworkBase.cs


示例5: SendNEventReportRequest

 protected void SendNEventReportRequest(byte presentationID, ushort messageID, DicomUID affectedClass, DicomUID affectedInstance, 
     ushort eventTypeID, DcmDataset dataset)
 {
     DcmCommand command = new DcmCommand();
     command.AffectedSOPClassUID = affectedClass;
     command.CommandField = DcmCommandField.NEventReportRequest;
     command.MessageID = messageID;
     command.HasDataset = (dataset != null);
     command.AffectedSOPInstanceUID = affectedInstance;
     command.EventTypeID = eventTypeID;
     Log.Info("{0} -> N-EventReport request [pc: {1}; id: {2}; class: {3}; event: {4:x4}]",
         LogID, presentationID, messageID, affectedClass.Description, eventTypeID);
     SendDimse(presentationID, command, dataset);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:14,代码来源:DcmNetworkBase.cs


示例6: OnSendDimseProgress

 protected virtual void OnSendDimseProgress(byte pcid, DcmCommand command, DcmDataset dataset, DcmDimseProgress progress)
 {
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:3,代码来源:DcmNetworkBase.cs


示例7: SendCCancelRequest

 protected void SendCCancelRequest(byte presentationID, ushort messageIdRespondedTo)
 {
     DcmCommand command = new DcmCommand();
     command.CommandField = DcmCommandField.CCancelRequest;
     command.MessageIDBeingRespondedTo = messageIdRespondedTo;
     command.HasDataset = false;
     Log.Info("{0} -> C-Cancel request [pc: {1}; id: {2}]", LogID, presentationID, messageIdRespondedTo);
     SendDimse(presentationID, command, null);
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:9,代码来源:DcmNetworkBase.cs


示例8: SendDimseStream

        private bool SendDimseStream(byte pcid, DcmCommand command, Stream datastream)
        {
            try {
                _disableTimeout = true;

                DicomTransferSyntax ts = _assoc.GetAcceptedTransferSyntax(pcid);

                DcmDimseProgress progress = new DcmDimseProgress();

                progress.EstimatedCommandLength = (int)command.CalculateWriteLength(DicomTransferSyntax.ImplicitVRLittleEndian, DicomWriteOptions.Default | DicomWriteOptions.CalculateGroupLengths);

                if (datastream != null)
                    progress.EstimatedDatasetLength = (int)datastream.Length - (int)datastream.Position;

                PDataTFStream pdustream = new PDataTFStream(_network, pcid, (int)_assoc.MaximumPduLength);
                pdustream.OnPduSent += delegate() {
                    progress.BytesTransfered = pdustream.BytesSent;
                    OnSendDimseProgress(pcid, command, null, progress);
                };

                lock (_socket) {
                    OnSendDimseBegin(pcid, command, null, progress);

                    DicomStreamWriter dsw = new DicomStreamWriter(pdustream);
                    dsw.Write(command, DicomWriteOptions.Default | DicomWriteOptions.CalculateGroupLengths);
                    dsw = null;

                    if (datastream != null) {
                        pdustream.IsCommand = false;
                        pdustream.Write(datastream);
                    }

                    // last pdu is automatically flushed when streaming
                    //pdustream.Flush(true);

                    OnSendDimse(pcid, command, null, progress);
                }

                return true;
            }
            catch (Exception e) {
            #if DEBUG
                Log.Error("{0} -> Error sending DIMSE: {1}", LogID, e.ToString());
            #else
                Log.Error("{0} -> Error sending DIMSE: {1}", LogID, e.Message);
            #endif
                OnNetworkError(e);
                return false;
            }
            finally {
                _disableTimeout = false;
            }
        }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:53,代码来源:DcmNetworkBase.cs


示例9: OnReceiveDimseBegin

 protected virtual void OnReceiveDimseBegin(byte pcid, DcmCommand command, DcmDataset dataset, DcmDimseProgress progress)
 {
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:3,代码来源:DcmNetworkBase.cs


示例10: SendDimse

        private bool SendDimse(byte pcid, DcmCommand command, DcmDataset dataset)
        {
            try {
                _disableTimeout = true;

                DicomTransferSyntax ts = _assoc.GetAcceptedTransferSyntax(pcid);

                if (dataset != null && ts != dataset.InternalTransferSyntax) {
                    if (ts.IsEncapsulated || dataset.InternalTransferSyntax.IsEncapsulated)
                        throw new DicomNetworkException("Unable to transcode encapsulated transfer syntax!");
                    dataset.ChangeTransferSyntax(ts, null);
                }

                DcmDimseProgress progress = new DcmDimseProgress();

                progress.EstimatedCommandLength = (int)command.CalculateWriteLength(DicomTransferSyntax.ImplicitVRLittleEndian, DicomWriteOptions.Default | DicomWriteOptions.CalculateGroupLengths);

                if (dataset != null)
                    progress.EstimatedDatasetLength = (int)dataset.CalculateWriteLength(ts, DicomWriteOptions.Default);

                PDataTFStream pdustream = new PDataTFStream(_network, pcid, (int)_assoc.MaximumPduLength);
                pdustream.OnPduSent += delegate() {
                    progress.BytesTransfered = pdustream.BytesSent;
                    OnSendDimseProgress(pcid, command, dataset, progress);
                };

                lock (_socket) {
                    OnSendDimseBegin(pcid, command, dataset, progress);

                    DicomStreamWriter dsw = new DicomStreamWriter(pdustream);
                    dsw.Write(command, DicomWriteOptions.Default | DicomWriteOptions.CalculateGroupLengths);

                    if (dataset != null) {
                        pdustream.IsCommand = false;
                        dsw.Write(dataset, DicomWriteOptions.Default);
                    }

                    // flush last pdu
                    pdustream.Flush(true);

                    OnSendDimse(pcid, command, dataset, progress);
                }

                return true;
            }
            catch (Exception e) {
            #if DEBUG
                Log.Error("{0} -> Error sending DIMSE: {1}", LogID, e.ToString());
            #else
                Log.Error("{0} -> Error sending DIMSE: {1}", LogID, e.Message);
            #endif
                OnNetworkError(e);
                return false;
            }
            finally {
                _disableTimeout = false;
            }
        }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:58,代码来源:DcmNetworkBase.cs


示例11: CreateResponse

 private DcmCommand CreateResponse(ushort messageIdRespondedTo, DcmCommandField commandField, DicomUID affectedClass, DcmStatus status, bool hasDataset)
 {
     DcmCommand command = new DcmCommand();
     command.AffectedSOPClassUID = affectedClass;
     command.CommandField = commandField;
     command.MessageIDBeingRespondedTo = messageIdRespondedTo;
     command.HasDataset = hasDataset;
     command.Status = status;
     if (!String.IsNullOrEmpty(status.ErrorComment))
         command.ErrorComment = status.ErrorComment;
     return command;
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:12,代码来源:DcmNetworkBase.cs


示例12: CreateRequest

 private DcmCommand CreateRequest(ushort messageID, DcmCommandField commandField, DicomUID affectedClass, DcmPriority priority, bool hasDataset)
 {
     DcmCommand command = new DcmCommand();
     command.AffectedSOPClassUID = affectedClass;
     command.CommandField = commandField;
     command.MessageID = messageID;
     command.Priority = priority;
     command.HasDataset = hasDataset;
     return command;
 }
开发者ID:JeanLedesma,项目名称:mdcm,代码行数:10,代码来源:DcmNetworkBase.cs


示例13: OnReceiveDimse

        protected override void OnReceiveDimse(byte pcid, DcmCommand command, DcmDataset dataset, DcmDimseProgress progress)
        {
            if (command.CommandField == DcmCommandField.CStoreRequest)
            {
                IsReceiveConnection = true;
                SaveDimseToFile(dataset);
            }

            base.OnReceiveDimse(pcid, command, dataset, progress);
        }
开发者ID:curasystems,项目名称:dicomserver,代码行数:10,代码来源:CImageServer.cs


示例14: CreateResponse

		private DcmCommand CreateResponse(ushort messageIdRespondedTo, DcmCommandField commandField, DicomUID affectedClass, DcmStatus status, bool hasDataset) {
			DcmCommand command = new DcmCommand();
			command.AffectedSOPClassUID = affectedClass;
			command.CommandField = commandField;
			command.MessageIDBeingRespondedTo = messageIdRespondedTo;
			command.HasDataset = hasDataset;
			command.Status = status;
			return command;
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DcmNetworkBase.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Network.DcmStatus类代码示例发布时间:2022-05-24
下一篇:
C# Data.DicomUID类代码示例发布时间: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