/// <summary> /// Initialize the DicomComparator /// </summary> /// <param name="dicomMessage"></param> /// <returns></returns> /// <returns>bool - true = template initialized, false template not initialized</returns> public bool Initialize(DvtkData.Dimse.DicomMessage dicomMessage) { DvtkData.Dimse.DimseCommand command = dicomMessage.CommandField; System.String sopClassUid = System.String.Empty; DvtkData.Dimse.Attribute attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.AFFECTED_SOP_CLASS_UID); if (attribute == null) { attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.REQUESTED_SOP_CLASS_UID); } if ((attribute != null) && (attribute.Length != 0)) { UniqueIdentifier uniqueIdentifier = (UniqueIdentifier)attribute.DicomValue; sopClassUid = uniqueIdentifier.Values[0]; } // Try to initialise a template _template = new DicomComparisonTemplate(); bool initialized = _template.Initialize(command, sopClassUid); if (initialized == true) { // Load the template with the corresponding attribute values initialized = LoadTemplate(dicomMessage.DataSet); } return(initialized); }
public bool SetUp(DvtkData.Dimse.DicomMessage dicomMessage) { DvtkData.Dimse.DimseCommand command = dicomMessage.CommandField; System.String sopClassUid = System.String.Empty; // To be fixed - why is the SOP Class UID not always filled in? // RB: TODO if (command == DvtkData.Dimse.DimseCommand.CSTORERQ) { sopClassUid = "1.2.840.10008.5.1.4.1.1.7"; } DvtkData.Dimse.Attribute attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.AFFECTED_SOP_CLASS_UID); if (attribute == null) { attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.REQUESTED_SOP_CLASS_UID); } if ((attribute != null) && (attribute.Length != 0)) { UniqueIdentifier uniqueIdentifier = (UniqueIdentifier)attribute.DicomValue; sopClassUid = uniqueIdentifier.Values[0]; } // Try to initialise a template _template = new DicomComparisonTemplate(); bool setUpDone = _template.Initialize(command, sopClassUid); return(setUpDone); }
public bool SetUp(DvtkData.Dimse.DicomMessage dicomMessage) { DvtkData.Dimse.DimseCommand command = dicomMessage.CommandField; System.String sopClassUid = System.String.Empty; // To be fixed - why is the SOP Class UID not always filled in? // RB: TODO if (command == DvtkData.Dimse.DimseCommand.CSTORERQ) { sopClassUid = "1.2.840.10008.5.1.4.1.1.7"; } DvtkData.Dimse.Attribute attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.AFFECTED_SOP_CLASS_UID); if (attribute == null) { attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.REQUESTED_SOP_CLASS_UID); } if ((attribute != null) && (attribute.Length != 0)) { UniqueIdentifier uniqueIdentifier = (UniqueIdentifier)attribute.DicomValue; sopClassUid = uniqueIdentifier.Values[0]; } // Try to initialise a template _template = new DicomComparisonTemplate(); bool setUpDone = _template.Initialize(command, sopClassUid); return setUpDone; }
/// <summary> /// Initialize the DicomComparator /// </summary> /// <param name="dicomMessage"></param> /// <returns></returns> /// <returns>bool - true = template initialized, false template not initialized</returns> public bool Initialize(DvtkData.Dimse.DicomMessage dicomMessage) { DvtkData.Dimse.DimseCommand command = dicomMessage.CommandField; System.String sopClassUid = System.String.Empty; DvtkData.Dimse.Attribute attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.AFFECTED_SOP_CLASS_UID); if (attribute == null) { attribute = dicomMessage.CommandSet.GetAttribute(DvtkData.Dimse.Tag.REQUESTED_SOP_CLASS_UID); } if ((attribute != null) && (attribute.Length != 0)) { UniqueIdentifier uniqueIdentifier = (UniqueIdentifier)attribute.DicomValue; sopClassUid = uniqueIdentifier.Values[0]; } // Try to initialise a template _template = new DicomComparisonTemplate(); bool initialized = _template.Initialize(command, sopClassUid); if (initialized == true) { // Load the template with the corresponding attribute values initialized = LoadTemplate(dicomMessage.DataSet); } return initialized; }