本文整理汇总了C#中DicomMessage.Dump方法的典型用法代码示例。如果您正苦于以下问题:C# DicomMessage.Dump方法的具体用法?C# DicomMessage.Dump怎么用?C# DicomMessage.Dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomMessage
的用法示例。
在下文中一共展示了DicomMessage.Dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StringBuilder
void IDicomServerHandler.OnReceiveRequestMessage(DicomServer server, ServerAssociationParameters association, byte presentationID, DicomMessage message)
{
if (message.CommandField == DicomCommandField.CEchoRequest)
{
server.SendCEchoResponse(presentationID, message.MessageId, DicomStatuses.Success);
return;
}
String studyInstanceUid = null;
String seriesInstanceUid = null;
DicomUid sopInstanceUid;
String patientName = null;
bool ok = message.DataSet[DicomTags.SopInstanceUid].TryGetUid(0, out sopInstanceUid);
if (ok) ok = message.DataSet[DicomTags.SeriesInstanceUid].TryGetString(0, out seriesInstanceUid);
if (ok) ok = message.DataSet[DicomTags.StudyInstanceUid].TryGetString(0, out studyInstanceUid);
if (ok) ok = message.DataSet[DicomTags.PatientsName].TryGetString(0, out patientName);
if (!ok)
{
Platform.Log(LogLevel.Error, "Unable to retrieve UIDs from request message, sending failure status.");
server.SendCStoreResponse(presentationID, message.MessageId, sopInstanceUid.UID,
DicomStatuses.ProcessingFailure);
return;
}
TransferSyntax syntax = association.GetPresentationContext(presentationID).AcceptedTransferSyntax;
if (List)
{
Platform.Log(LogLevel.Info, message.Dump());
}
if (Bitbucket)
{
Platform.Log(LogLevel.Info, "Received SOP Instance: {0} for patient {1} in syntax {2}", sopInstanceUid,
patientName, syntax.Name);
server.SendCStoreResponse(presentationID, message.MessageId,
sopInstanceUid.UID,
DicomStatuses.Success);
return;
}
if (!Directory.Exists(StorageLocation))
Directory.CreateDirectory(StorageLocation);
var path = new StringBuilder();
path.AppendFormat("{0}{1}{2}{3}{4}", StorageLocation, Path.DirectorySeparatorChar,
studyInstanceUid, Path.DirectorySeparatorChar,seriesInstanceUid);
Directory.CreateDirectory(path.ToString());
path.AppendFormat("{0}{1}.dcm", Path.DirectorySeparatorChar, sopInstanceUid.UID);
var dicomFile = new DicomFile(message, path.ToString())
{
TransferSyntaxUid = syntax.UidString,
MediaStorageSopInstanceUid = sopInstanceUid.UID,
ImplementationClassUid = DicomImplementation.ClassUID.UID,
ImplementationVersionName = DicomImplementation.Version,
SourceApplicationEntityTitle = association.CallingAE,
MediaStorageSopClassUid = message.SopClass.Uid
};
dicomFile.Save(DicomWriteOptions.None);
Platform.Log(LogLevel.Info, "Received SOP Instance: {0} for patient {1} in syntax {2}", sopInstanceUid,
patientName, syntax.Name);
server.SendCStoreResponse(presentationID, message.MessageId,
sopInstanceUid.UID,
DicomStatuses.Success);
}