internal FileMetaInformation(DvtkData.Dimse.AttributeSet dvtkDataAttributeSet) : base(dvtkDataAttributeSet) { if (dvtkDataAttributeSet == null) { DvtkHighLevelInterfaceException.Throw("Parameter may not be null/Nothing."); } }
private static void AddDicomAttribute(DvtkData.Dimse.AttributeSet dataset, DicomTagPath dicomTagPath, System.String dicomValue) { if (dicomTagPath.Next != null) { // Try to get the sequence identified by this Tag DvtkData.Dimse.Attribute sequenceAttribute = dataset.GetAttribute(dicomTagPath.Tag); if (sequenceAttribute == null) { // Need to add the sequence DvtkData.Dimse.SequenceItem item = new DvtkData.Dimse.SequenceItem(); dataset.AddAttribute(dicomTagPath.Tag.GroupNumber, dicomTagPath.Tag.ElementNumber, DvtkData.Dimse.VR.SQ, item); // Get the newly added sequence sequenceAttribute = dataset.GetAttribute(dicomTagPath.Tag); } // Get the contained item DvtkData.Dimse.SequenceOfItems sequenceOfItems = (DvtkData.Dimse.SequenceOfItems)sequenceAttribute.DicomValue; if (sequenceOfItems.Sequence.Count == 1) { DvtkData.Dimse.SequenceItem item = sequenceOfItems.Sequence[0]; // Call recursively AddDicomAttribute(item, dicomTagPath.Next, dicomValue); } } else { // Try to get the attribute identified by this Tag DvtkData.Dimse.Attribute attribute = dataset.GetAttribute(dicomTagPath.Tag); if (attribute != null) { // If present - remove the attribute - we want to update the value dataset.Remove(attribute); } // Add the new value dataset.AddAttribute(dicomTagPath.Tag.GroupNumber, dicomTagPath.Tag.ElementNumber, DicomTagVrLookup.GetVR(dicomTagPath.Tag), dicomValue); } }
/// <summary> /// Constructor. /// </summary> /// <param name="dvtkDataAttributeSet">The encapsulated DvtkData Attribute Set.</param> /// <param name="tagSequence">The TagSequence (see property TagSequence).</param> internal AttributeSet(TagSequence tagSequence, DvtkData.Dimse.AttributeSet dvtkDataAttributeSet) { this.dvtkDataAttributeSet = dvtkDataAttributeSet; this.tagSequence = tagSequence; }
// // - Constructors - // /// <summary> /// Constructor for a root AttributeSet (like a Command Set, Data Set or File Meta information). /// </summary> /// <param name="dvtkDataAttributeSet">The encapsulated DvtkData Attribute Set.</param> internal AttributeSet(DvtkData.Dimse.AttributeSet dvtkDataAttributeSet) { this.dvtkDataAttributeSet = dvtkDataAttributeSet; this.tagSequence = new TagSequence(); }
// // - Constructors - // /// <summary> /// Constructor. /// </summary> /// <param name="dvtkDataAttributeSet">The encapsulated DvtkData Attribute Set</param> internal AttributeSet(DvtkData.Dimse.AttributeSet dvtkDataAttributeSet) { this.dvtkDataAttributeSet = dvtkDataAttributeSet; }