/// <summary> /// Class constructor. /// </summary> /// <param name="parentSequenceTag">Parent Sequence Tag</param> /// <param name="tag">Comparison Tag</param> /// <param name="vr">Tag VR</param> /// <param name="commonDataFormat">Data Format for Tag</param> public DicomComparisonTag(DvtkData.Dimse.Tag parentSequenceTag, DvtkData.Dimse.Tag tag, VR vr, BaseCommonDataFormat commonDataFormat) { _parentSequenceTag = parentSequenceTag; _tag = tag; _vr = vr; _commonDataFormat = commonDataFormat; }
/// <summary> /// Class constructor. /// </summary> /// <param name="tag">Comparison Tag</param> /// <param name="vr">Tag VR.</param> /// <param name="commonDataFormat">Data Format for Tag</param> public DicomComparisonTag(DvtkData.Dimse.Tag tag, VR vr, BaseCommonDataFormat commonDataFormat) { _tag = tag; _vr = vr; _commonDataFormat = commonDataFormat; }
private static void AddDefaultValueEvenIfZeroLength(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, DvtkData.Dimse.Tag tag, VR vr, DvtkData.Dimse.AttributeSet attributeSet) { // Only add a default value if the attribute does not already exist or has a zero length DvtkData.Dimse.Attribute attribute = attributeSet.GetAttribute(tag); if (attribute == null) { // Attribute does not exist so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } else if (attribute.Length == 0) { // Remove the existing attribute attributeSet.Remove(attribute); // Attribute had zero length so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } }
private static void AddDefaultValue(Dvtk.Dicom.InformationEntity.DefaultValues.DefaultValueManager defaultValueManager, DvtkData.Dimse.Tag tag, VR vr, DvtkData.Dimse.AttributeSet attributeSet) { // Only add a default value if the attribute does not already exist DvtkData.Dimse.Attribute attribute = attributeSet.GetAttribute(tag); if (attribute == null) { // Attribute does not exist so add a default value System.String lValue = defaultValueManager.GetInstantiatedValue(tag); attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, lValue); } }
private static void UpdateValue(System.String attributeValue, DvtkData.Dimse.Tag tag, VR vr, DvtkData.Dimse.AttributeSet attributeSet) { // Only update the value if the dataset contains an attribute with the same tag DvtkData.Dimse.Attribute attribute = attributeSet.GetAttribute(tag); if (attribute != null) { // Remove the existing attribute attributeSet.Remove(attribute); // Add the new (updated) value attributeSet.AddAttribute(tag.GroupNumber, tag.ElementNumber, (DvtkData.Dimse.VR)vr, attributeValue); } }