"景先生毕设|www.jxszl.com

C# ClientAssociationParameters类代码示例

2023-12-29 17:44编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中ClientAssociationParameters类的典型用法代码示例。如果您正苦于以下问题:C#ClientAssociationParameters类的具体用法?C#ClientAssociationParameters怎么用?C#ClientAssociationParameters使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:SendCStore /// ///GenericroutinetosendthenextC-STORE-RQmessageinthe. /// ///DICOMClientclass ///AssociationParameters privateboolSendCStore(DicomClientclient,ClientAssociationParametersassociation) { StorageInstancefileToSend=_storageInstanceList[_fileListIndex]; OnImageStoreStarted(fileToSend); DicomFiledicomFile; try { //Checktoseeifimagedoesnotexistoriscorrupted if(fileToSend.SendStatus==DicomStatuses.ProcessingFailure) { _failureSubOperations++; _remainingSubOperations--; OnImageStoreCompleted(fileToSend); returnfalse; } dicomFile=fileToSend.LoadFile(); } catch(DicomExceptione) { Platform.Log(LogLevel.Error,e,"UnexpectedexceptionwhenloadingDICOMfile{0}",fileToSend.Filename); fileToSend.ExtendedFailureDescription=e.GetType().Name+""+e.Message; _failureSubOperations++; _remainingSubOperations--; OnImageStoreCompleted(fileToSend); returnfalse; } DicomMessagemsg=newDicomMessage(dicomFile); bytepcid=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="Novalidpresentationcontextsforfile."; OnImageStoreCompleted(fileToSend); _failureSubOperations++; _remainingSubOperations--; returnfalse; } 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;//ThisisaDicomException-derivedclassthatwewanttothrow. } catch(DicomCodecExceptione) { Platform.Log(LogLevel.Error,e,"Unexpectedexceptionwhencompressingordecompressingfilebeforesend{0}",fileToSend.Filename); fileToSend.SendStatus=DicomStatuses.ProcessingFailure; fileToSend.ExtendedFailureDescription="Errordecompressingorcompressingfilebeforesend."; OnImageStoreCompleted(fileToSend); _failureSubOperations++; _remainingSubOperations--; returnfalse; } catch(DicomExceptione) //.........这里部分代码省略.........
原文链接:http://www.jxszl.com/biancheng/C/556760.html