当前位置: 首页>>代码示例>>C#>>正文


C# DicomClient.SendCStoreRequest方法代码示例

本文整理汇总了C#中DicomClient.SendCStoreRequest方法的典型用法代码示例。如果您正苦于以下问题:C# DicomClient.SendCStoreRequest方法的具体用法?C# DicomClient.SendCStoreRequest怎么用?C# DicomClient.SendCStoreRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DicomClient的用法示例。


在下文中一共展示了DicomClient.SendCStoreRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendOnPresentationContext

        private void SendOnPresentationContext(DicomClient client, ClientAssociationParameters association, byte pcid, StorageInstance fileToSend, DicomMessage msg)
        {
            var presContext = association.GetPresentationContext(pcid);
            if (msg.TransferSyntax.Encapsulated
                && presContext.AcceptedTransferSyntax.Encapsulated
                && !msg.TransferSyntax.Equals(presContext.AcceptedTransferSyntax))
            {
                // Compressed in different syntaxes, decompress here first, ChangeTransferSyntax does not convert syntaxes properly in this case.
                msg.ChangeTransferSyntax(TransferSyntax.ExplicitVrLittleEndian);
            }

            fileToSend.SentMessageId = client.NextMessageID();

            if (_moveOriginatorAe == null)
                client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, msg);
            else
                client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, _moveOriginatorAe,
                                         _moveOriginatorMessageId, msg);
        }
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:19,代码来源:StorageScu.cs

示例2: SendFilePresentationContext

		private void SendFilePresentationContext(DicomClient client, byte pcid, StorageInstance fileToSend)
		{
			fileToSend.SentMessageId = client.NextMessageID();

			if (fileToSend.MetaInfoFileLength == 0)
			{
				DicomFile theFile = new DicomFile(fileToSend.Filename);
				theFile.Load(DicomTags.RelatedGeneralSopClassUid, DicomReadOptions.Default);
				fileToSend.MetaInfoFileLength = theFile.MetaInfoFileLength;
			}

			using (var fs = FileStreamOpener.OpenForRead(fileToSend.Filename, FileMode.Open))
			{
				// Seek to the Dataset
				fs.Seek(fileToSend.MetaInfoFileLength, SeekOrigin.Begin);

				if (_moveOriginatorAe == null)
					client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, null, 0, fileToSend.SopInstanceUid,
					                         fileToSend.SopClass.Uid, fs);
				else
					client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, _moveOriginatorAe, _moveOriginatorMessageId, fileToSend.SopInstanceUid,
											 fileToSend.SopClass.Uid, fs);
			}
		}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:24,代码来源:StorageScu.cs

示例3: SendCStore

		/// <summary>
		/// Generic routine to send the next C-STORE-RQ message in the <see cref="StorageInstanceList"/>.
		/// </summary>
		/// <param name="client">DICOM Client class</param>
		/// <param name="association">Association Parameters</param>
		private bool SendCStore(DicomClient client, ClientAssociationParameters association)
		{
			StorageInstance fileToSend = _storageInstanceList[_fileListIndex];

			OnImageStoreStarted(fileToSend);

			DicomFile dicomFile;

			try
			{
				// Check to see if image does not exist or is corrupted
				if (fileToSend.SendStatus == DicomStatuses.ProcessingFailure)
				{
					_failureSubOperations++;
					_remainingSubOperations--;
					OnImageStoreCompleted(fileToSend);
					return false;
				}

				dicomFile = fileToSend.LoadFile();
			}
			catch (DicomException e)
			{
				Platform.Log(LogLevel.Error, e, "Unexpected exception when loading DICOM file {0}", fileToSend.Filename);

				fileToSend.ExtendedFailureDescription = e.GetType().Name + " " + e.Message;
				_failureSubOperations++;
				_remainingSubOperations--;
				OnImageStoreCompleted(fileToSend);
				return false;
			}

			DicomMessage msg = new DicomMessage(dicomFile);

			byte pcid = 0;

			if (fileToSend.TransferSyntax.Encapsulated)
			{
				pcid = association.FindAbstractSyntaxWithTransferSyntax(fileToSend.SopClass, fileToSend.TransferSyntax);

				if (DicomCodecRegistry.GetCodec(fileToSend.TransferSyntax) != null)
				{
					if (pcid == 0)
						pcid = association.FindAbstractSyntaxWithTransferSyntax(fileToSend.SopClass,
						                                                        TransferSyntax.ExplicitVrLittleEndian);
					if (pcid == 0)
						pcid = association.FindAbstractSyntaxWithTransferSyntax(fileToSend.SopClass,
						                                                        TransferSyntax.ImplicitVrLittleEndian);
				}
			}
			else
			{
				if (pcid == 0)
					pcid = association.FindAbstractSyntaxWithTransferSyntax(fileToSend.SopClass,
					                                                        TransferSyntax.ExplicitVrLittleEndian);
				if (pcid == 0)
					pcid = association.FindAbstractSyntaxWithTransferSyntax(fileToSend.SopClass,
					                                                        TransferSyntax.ImplicitVrLittleEndian);
			}

			if (pcid == 0)
			{
				fileToSend.SendStatus = DicomStatuses.SOPClassNotSupported;
				fileToSend.ExtendedFailureDescription = "No valid presentation contexts for file.";
				OnImageStoreCompleted(fileToSend);
				_failureSubOperations++;
				_remainingSubOperations--;
				return false;
			}

			try
			{
				if (_moveOriginatorAe == null)
					client.SendCStoreRequest(pcid, client.NextMessageID(), DicomPriority.Medium, msg);
				else
					client.SendCStoreRequest(pcid, client.NextMessageID(), DicomPriority.Medium, _moveOriginatorAe,
					                         _moveOriginatorMessageId, msg);
			}
			catch(DicomNetworkException)
			{
				throw; //This is a DicomException-derived class that we want to throw.
			}
			catch(DicomCodecException e)
			{
				Platform.Log(LogLevel.Error, e, "Unexpected exception when compressing or decompressing file before send {0}", fileToSend.Filename);

				fileToSend.SendStatus = DicomStatuses.ProcessingFailure;
				fileToSend.ExtendedFailureDescription = "Error decompressing or compressing file before send.";
				OnImageStoreCompleted(fileToSend);
				_failureSubOperations++;
				_remainingSubOperations--;
				return false;

			}
			catch(DicomException e)
//.........这里部分代码省略.........
开发者ID:khaha2210,项目名称:radio,代码行数:101,代码来源:StorageScu.cs

示例4: SendFilePresentationContext

		private void SendFilePresentationContext(DicomClient client, byte pcid, StorageInstance fileToSend)
		{
			fileToSend.SentMessageId = client.NextMessageID();

			fileToSend.ParseMetaInfo();

			using (var fs = fileToSend.StreamOpener.Open())
			{
				// Seek to the Dataset
				fs.Seek(fileToSend.MetaInfoFileLength, SeekOrigin.Begin);

				if (_moveOriginatorAe == null)
					client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, null, 0, fileToSend.SopInstanceUid,
					                         fileToSend.SopClass.Uid, fs);
				else
					client.SendCStoreRequest(pcid, fileToSend.SentMessageId, DicomPriority.Medium, _moveOriginatorAe, _moveOriginatorMessageId, fileToSend.SopInstanceUid,
					                         fileToSend.SopClass.Uid, fs);
			}
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:19,代码来源:StorageScu.cs


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