Пример #1
0
        // -------------------------------
        // - Begin public methods region -
        // -------------------------------
        /// <summary>
        /// Convert a HLI Attribute Set to a AttributeLayer Attribute Set.
        /// </summary>
        /// <param name="attributeSetIn">The HLI Attribute Set.</param>
        /// <param name="attributeSetOut">The AttributeLayer Attribute Set.</param>
        public static void ToAttributeSet(DvtkHighLevelInterface.Dicom.Other.AttributeSet attributeSetIn, Dvtk.Dicom.AttributeLayer.AttributeSet attributeSetOut)
        {
            for (int index = 0; index < attributeSetIn.Count; index++)
            {
                DvtkHighLevelInterface.Dicom.Other.Attribute hliAttribute = attributeSetIn[index];

                Tag tag = new Tag(hliAttribute.GroupNumber, hliAttribute.ElementNumber);

                if (hliAttribute.VR != DvtkData.Dimse.VR.SQ)
                {
                    SingleAttribute singleAttribute = new SingleAttribute(tag, (VR)Enum.Parse(typeof(VR), hliAttribute.VR.ToString(), true), attributeSetOut);
                }
                else
                {
                    SequenceAttribute sequenceAttribute = new SequenceAttribute(tag, attributeSetOut);

                    for (int sequenceItemIndex = 1; sequenceItemIndex <= hliAttribute.ItemCount; sequenceItemIndex++)
                    {
                        DvtkHighLevelInterface.Dicom.Other.SequenceItem hliSequenceItem = hliAttribute.GetItem(sequenceItemIndex);

                        SequenceItem sequenceItem = new SequenceItem(sequenceAttribute);

                        ToAttributeSet(hliSequenceItem, sequenceItem);
                    }
                }
            }
        }
        /// <summary>
        /// VisitEnter method in the context of the "Hierarchical Visitor Pattern".
        /// See "DVTk_Library\Documentation\Design\Hierarchical Visitor Pattern.htm".
        /// </summary>
        /// <param name="sequenceAttribute">The SequenceAttribute instance to visit.</param>
        /// <returns>
        /// true: traverse the children of this instance.
        /// false: do not traverse the children of this instance.
        /// </returns>
        public override bool VisitEnterSequenceAttribute(SequenceAttribute sequenceAttribute)
        {
            VisitAttribute(sequenceAttribute);

            return (true);
        }
Пример #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="parent">
 /// The parent of this instance (the Sequence Attribute this instance is contained in)</param>
 public SequenceItem(SequenceAttribute parent)
 {
     this.parent = parent;
     parent.SequenceItems.Add(this);
 }
Пример #4
0
 /// <summary>
 /// VisitLeave method in the context of the "Hierarchical Visitor Pattern".
 /// See "DVTk_Library\Documentation\Design\Hierarchical Visitor Pattern.htm".
 /// </summary>
 /// <param name="sequenceAttribute">The SequenceAttribute instance to visit.</param>
 /// <returns>
 /// true: continue traversing the siblings of the supplied instance.
 /// false: stop traversing the siblings of the supplied instance.
 /// </returns>
 public virtual bool VisitLeaveSequenceAttribute(SequenceAttribute sequenceAttribute)
 {
     return(true);
 }
Пример #5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="parent">
 /// The parent of this instance (the Sequence Attribute this instance is contained in)</param>
 public SequenceItem(SequenceAttribute parent)
 {
     this.parent = parent;
     parent.SequenceItems.Add(this);
 }