本文整理汇总了C#中DvtkHighLevelInterface.Dicom.Messages.DicomMessage类的典型用法代码示例。如果您正苦于以下问题:C# DicomMessage类的具体用法?C# DicomMessage怎么用?C# DicomMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DicomMessage类属于DvtkHighLevelInterface.Dicom.Messages命名空间,在下文中一共展示了DicomMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
}
}