Example #1
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// <br></br>
        /// Get the next collection of attributes to compare to each other.
        /// If an attribute is not present, a null pointer is returned in the AttributeCollection.
        /// If all attributes have been compared, null is returned.
        /// </summary>
        /// <returns>The attributes to compare.</returns>
        public DicomAttributesToValidate GetNextAttributes()
        {
            DicomAttributesToValidate dicomAttributesToValidate = null;

            if (this.validationRuleListsIndex >= validationRuleLists.Count)
            {
                dicomAttributesToValidate = null;
            }
            else
            {
                dicomAttributesToValidate = new DicomAttributesToValidate();

                ValidationRuleList validationRuleList = this.validationRuleLists[this.validationRuleListsIndex] as ValidationRuleList;

                for (int attributeSetsIndex = 0; attributeSetsIndex < this.attributeSets.Count; attributeSetsIndex++)
                {
                    DicomAttributeToValidate     dicomAttributeToValidate     = new DicomAttributeToValidate();
                    AttributeSet                 attributeSet                 = this.attributeSets[attributeSetsIndex] as AttributeSet;
                    ValidationRuleDicomAttribute validationRuleDicomAttribute = validationRuleList[attributeSetsIndex] as ValidationRuleDicomAttribute;

                    if (validationRuleDicomAttribute.TagSequence != "")
                    {
                        dicomAttributeToValidate.Attribute = attributeSet[validationRuleDicomAttribute.TagSequence];
                    }
                    dicomAttributeToValidate.ValidationRuleDicomAttribute = validationRuleDicomAttribute;
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.DisplayFullTagSequence = true;

                    dicomAttributesToValidate.Add(dicomAttributeToValidate);
                }

                this.validationRuleListsIndex++;
            }

            return(dicomAttributesToValidate);
        }
Example #2
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="attributeSets">-</param>
        /// <param name="validationRuleLists">-</param>
        internal protected void AddAttributeSetsInformationUsingDynamicCompare(ArrayList attributeSets, ArrayList validationRuleLists)
        {
            //
            // Iterate through all attributes of all AttributeSets.
            //

            GeneratorDynamicCompare generatorDynamicCompare = new GeneratorDynamicCompare(attributeSets, validationRuleLists);

            DicomAttributesToValidate dicomAttributesToValidate = null;

            while ((dicomAttributesToValidate = generatorDynamicCompare.GetNextAttributes()) != null)
            {
                AddAttributesInformation(dicomAttributesToValidate);

                if (this.addEmptyRowAfterEachDynamicComparedList)
                {
                    NewRow();

                    for (int columnIndex = 0; columnIndex < this.numberOfColumns; columnIndex++)
                    {
                        SetCellOK(columnIndex + 1, ".");
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// <br></br>
        /// Get the next collection of attributes to compare to each other.
        /// If an attribute is not present, a null pointer is returned in the AttributeCollection.
        /// If all attributes have been compared, null is returned.
        /// </summary>
        /// <returns>The attributes to compare.</returns>
        public DicomAttributesToValidate GetNextAttributes()
        {
            DicomAttributesToValidate dicomAttributesToValidate = null;

            if (this.validationRuleListsIndex >= validationRuleLists.Count)
            {
                dicomAttributesToValidate = null;
            }
            else
            {
                dicomAttributesToValidate = new DicomAttributesToValidate();

                ValidationRuleList validationRuleList = this.validationRuleLists[this.validationRuleListsIndex] as ValidationRuleList;

                for (int attributeSetsIndex = 0; attributeSetsIndex < this.attributeSets.Count; attributeSetsIndex++)
                {
                    DicomAttributeToValidate dicomAttributeToValidate = new DicomAttributeToValidate();
                    AttributeSet attributeSet = this.attributeSets[attributeSetsIndex] as AttributeSet;
                    ValidationRuleDicomAttribute validationRuleDicomAttribute = validationRuleList[attributeSetsIndex] as ValidationRuleDicomAttribute;

                    if (validationRuleDicomAttribute.TagSequence != "")
                    {
                        dicomAttributeToValidate.Attribute = attributeSet[validationRuleDicomAttribute.TagSequence];
                    }
                    dicomAttributeToValidate.ValidationRuleDicomAttribute = validationRuleDicomAttribute;
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.DisplayFullTagSequence = true;

                    dicomAttributesToValidate.Add(dicomAttributeToValidate);
                }

                this.validationRuleListsIndex++;
            }

            return(dicomAttributesToValidate);
        }
Example #4
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        private void AddCommonInformationForAttributes(DicomAttributesToValidate dicomAttributesToValidate)
        {
            bool isLeadingAttributePresent            = false;
            DicomAttributeToValidate leadingAttribute = dicomAttributesToValidate.LeadingAttribute;

            if (leadingAttribute.Attribute is ValidAttribute)
            {
                isLeadingAttributePresent = true;
            }
            else
            {
                isLeadingAttributePresent = false;
            }


            //
            // Fill in the common information.
            //

            // Common Tag column.
            if (this.displayCommonTag)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonTag, ((ValidAttribute)leadingAttribute.Attribute).TagSequence.DicomNotation);
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonTag);
                }
            }

            // Common Name column.
            if (this.displayCommonName)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonName, GetAttributeName(leadingAttribute.Attribute));
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonName);
                }
            }

            // Common VR column.
            if (this.displayCommonVR)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonVR, leadingAttribute.Attribute.VR.ToString());
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonVR);
                }
            }
        }
Example #5
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="attributeSets">-</param>
        /// <param name="compareFlagsForAttributeSets">-</param>
        /// <param name="dicomAttributeFlagsForAttributeSets">-</param>
        /// <param name="displayAttributeSets">-</param>
        internal protected void AddAttributeSetsInformationUsingStaticCompare(ArrayList attributeSets, ArrayList compareFlagsForAttributeSets, ArrayList dicomAttributeFlagsForAttributeSets, ArrayList displayAttributeSets)
        {
            //
            // Iterate through all attributes of all AttributeSets.
            //

            GeneratorStaticCompare generatorStaticCompare = new GeneratorStaticCompare(attributeSets);

            DicomAttributesToValidate dicomAttributesToValidate = null;

            while ((dicomAttributesToValidate = generatorStaticCompare.GetNextAttributes(compareFlagsForAttributeSets, dicomAttributeFlagsForAttributeSets, displayAttributeSets)) != null)
            {
                AddAttributesInformation(dicomAttributesToValidate);
            }
        }
Example #6
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        private void AddAttributesInformation(DicomAttributesToValidate dicomAttributesToValidate)
        {
            NewRow();


            //
            // Fill in the common information.
            //

            AddCommonInformationForAttributes(dicomAttributesToValidate);


            //
            // Fill in the information specific for each attribute.
            //

            for (int index = 0; index < dicomAttributesToValidate.Count; index++)
            {
                AddAttributeInformationForAttribute(dicomAttributesToValidate, index);
            }


            //
            // If at least one attribute is a sequence attribute, do a comparison of the content.
            //

            if (dicomAttributesToValidate.ContainsSequenceAttribute)
            {
                // If a sequence attribute is present, also a leading attribute must be present of type ValidAttribute.
                int oneBasedLevel = (dicomAttributesToValidate.LeadingAttribute.Attribute as ValidAttribute).TagSequence.Tags.Count;

                // !!!!! DicomAttributesToValidate convertedToSequenceAttributes = dicomAttributesToValidate.ConvertedToSequenceAttributes;
                // !!!!! AddSequenceAttributesContentInformation(convertedToSequenceAttributes, oneBasedLevel);

                AddSequenceAttributesContentInformation(dicomAttributesToValidate, oneBasedLevel);
            }
        }
Example #7
0
        //
        // - Methods -
        //
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="compareFlagsForAttributeSets">-</param>
        /// <param name="dicomAttributeFlagsForAttributeSets">-</param>
        /// <param name="displayAttributeSets">-</param>
        /// <returns>-</returns>
        public DicomAttributesToValidate GetNextAttributes(ArrayList compareFlagsForAttributeSets, ArrayList dicomAttributeFlagsForAttributeSets, ArrayList displayAttributeSets)
        {
            DicomAttributesToValidate dicomAttributesToValidate = new DicomAttributesToValidate();
            Tag lowestTag = null;
            String lowestTagSequenceAsString = "";

            // Make first collection of attributes, containing ValidAttribute instances (if an
            // attribute set still contains unprocessed attributes) and InvalidAttribute
            // instances (if no more attributes are left in an attribute set).
            //
            // At the same time, determine what the lowest tag is.
            for (int index = 0; index < this.attributeSets.Count; index++)
            {
                int attributeSetIndex = (int)this.currentAttributeIndices[index];
                AttributeSet attributeSet = this.attributeSets[index] as AttributeSet;

                if (attributeSetIndex < attributeSet.Count)
                    // Still unprocessed attributes left in this dataset.
                {
                    ValidAttribute attribute = attributeSet[attributeSetIndex] as ValidAttribute;

                    DicomAttributeToValidate dicomAttributeToValidate = new DicomAttributeToValidate();
                    dicomAttributeToValidate.Attribute = attribute;
                    dicomAttributesToValidate.Add(dicomAttributeToValidate);

                    TagSequence tagSequence = attribute.TagSequence;
                    Tag lastTag = tagSequence.Tags[tagSequence.Tags.Count - 1] as Tag;

                    if (lowestTag == null)
                    {
                        lowestTag = lastTag;
                        lowestTagSequenceAsString = tagSequence.ToString();
                    }
                    else
                    {
                        if (lastTag.AsUInt32 < lowestTag.AsUInt32)
                        {
                            lowestTag = lastTag;
                            lowestTagSequenceAsString = tagSequence.ToString();
                        }
                    }
                }
                else
                    // No more unprocessed attributes left in this dataset.
                {
                    dicomAttributesToValidate.Add(new DicomAttributeToValidate());
                }
            }

            if (lowestTag != null)
            {
                // Now the lowest tag is known.
                // Make all ValidAttributes present that have a tag higher then the lowest tag InvalidAttributes.
                for (int index = 0; index < dicomAttributesToValidate.Count; index++)
                {
                    if (((DicomAttributeToValidate)dicomAttributesToValidate[index]).Attribute is ValidAttribute)
                    {
                        ValidAttribute validAttribute = ((DicomAttributeToValidate)dicomAttributesToValidate[index]).Attribute as ValidAttribute;
                        TagSequence tagSequence = validAttribute.TagSequence;
                        Tag lastTag = tagSequence.Tags[tagSequence.Tags.Count - 1] as Tag;

                        if (lastTag.AsUInt32 > lowestTag.AsUInt32)
                        {
                            dicomAttributesToValidate[index] = new DicomAttributeToValidate();
                        }
                        else
                        {
                            // This attribute will be returned. Increase the attribute index.
                            int newAttributeIndex = (int)(this.currentAttributeIndices[index]);
                            newAttributeIndex++;
                            this.currentAttributeIndices[index] = newAttributeIndex;
                        }
                    }
                }

                // Make sure all compare flags are set.
                // Also whenever an attribute is not present, make sure the tag is filled in in the
                // ValidationRuleDicomAttribute.TagSequence, because this will indicate that it needs to
                // be displayed.
                for (int index = 0; index < dicomAttributesToValidate.Count; index++)
                {
                    DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[index] as DicomAttributeToValidate;
                    if ((bool)(displayAttributeSets[index]))
                    {
                        dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence = lowestTagSequenceAsString;
                    }
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags = (CompareFlags)compareFlagsForAttributeSets[index];
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags = (DicomAttributeFlags)dicomAttributeFlagsForAttributeSets[index];
                }
            }
            else
            {
                // Assign the null pointer to indicate no attributes are unprocessed anymore.
                dicomAttributesToValidate = null;
            }

            return(dicomAttributesToValidate);
        }
Example #8
0
        //
        // - Methods -
        //

        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="compareFlagsForAttributeSets">-</param>
        /// <param name="dicomAttributeFlagsForAttributeSets">-</param>
        /// <param name="displayAttributeSets">-</param>
        /// <returns>-</returns>
        public DicomAttributesToValidate GetNextAttributes(ArrayList compareFlagsForAttributeSets, ArrayList dicomAttributeFlagsForAttributeSets, ArrayList displayAttributeSets)
        {
            DicomAttributesToValidate dicomAttributesToValidate = new DicomAttributesToValidate();
            Tag    lowestTag = null;
            String lowestTagSequenceAsString = "";

            // Make first collection of attributes, containing ValidAttribute instances (if an
            // attribute set still contains unprocessed attributes) and InvalidAttribute
            // instances (if no more attributes are left in an attribute set).
            //
            // At the same time, determine what the lowest tag is.
            for (int index = 0; index < this.attributeSets.Count; index++)
            {
                int          attributeSetIndex = (int)this.currentAttributeIndices[index];
                AttributeSet attributeSet      = this.attributeSets[index] as AttributeSet;

                if (attributeSetIndex < attributeSet.Count)
                // Still unprocessed attributes left in this dataset.
                {
                    ValidAttribute attribute = attributeSet[attributeSetIndex] as ValidAttribute;

                    DicomAttributeToValidate dicomAttributeToValidate = new DicomAttributeToValidate();
                    dicomAttributeToValidate.Attribute = attribute;
                    dicomAttributesToValidate.Add(dicomAttributeToValidate);

                    TagSequence tagSequence = attribute.TagSequence;
                    Tag         lastTag     = tagSequence.Tags[tagSequence.Tags.Count - 1] as Tag;

                    if (lowestTag == null)
                    {
                        lowestTag = lastTag;
                        lowestTagSequenceAsString = tagSequence.ToString();
                    }
                    else
                    {
                        if (lastTag.AsUInt32 < lowestTag.AsUInt32)
                        {
                            lowestTag = lastTag;
                            lowestTagSequenceAsString = tagSequence.ToString();
                        }
                    }
                }
                else
                // No more unprocessed attributes left in this dataset.
                {
                    dicomAttributesToValidate.Add(new DicomAttributeToValidate());
                }
            }

            if (lowestTag != null)
            {
                // Now the lowest tag is known.
                // Make all ValidAttributes present that have a tag higher then the lowest tag InvalidAttributes.
                for (int index = 0; index < dicomAttributesToValidate.Count; index++)
                {
                    if (((DicomAttributeToValidate)dicomAttributesToValidate[index]).Attribute is ValidAttribute)
                    {
                        ValidAttribute validAttribute = ((DicomAttributeToValidate)dicomAttributesToValidate[index]).Attribute as ValidAttribute;
                        TagSequence    tagSequence    = validAttribute.TagSequence;
                        Tag            lastTag        = tagSequence.Tags[tagSequence.Tags.Count - 1] as Tag;

                        if (lastTag.AsUInt32 > lowestTag.AsUInt32)
                        {
                            dicomAttributesToValidate[index] = new DicomAttributeToValidate();
                        }
                        else
                        {
                            // This attribute will be returned. Increase the attribute index.
                            int newAttributeIndex = (int)(this.currentAttributeIndices[index]);
                            newAttributeIndex++;
                            this.currentAttributeIndices[index] = newAttributeIndex;
                        }
                    }
                }

                // Make sure all compare flags are set.
                // Also whenever an attribute is not present, make sure the tag is filled in in the
                // ValidationRuleDicomAttribute.TagSequence, because this will indicate that it needs to
                // be displayed.
                for (int index = 0; index < dicomAttributesToValidate.Count; index++)
                {
                    DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[index] as DicomAttributeToValidate;
                    if ((bool)(displayAttributeSets[index]))
                    {
                        dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence = lowestTagSequenceAsString;
                    }
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags        = (CompareFlags)compareFlagsForAttributeSets[index];
                    dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags = (DicomAttributeFlags)dicomAttributeFlagsForAttributeSets[index];
                }
            }
            else
            {
                // Assign the null pointer to indicate no attributes are unprocessed anymore.
                dicomAttributesToValidate = null;
            }

            return(dicomAttributesToValidate);
        }
Example #9
0
        private void AddSequenceAttributesContentInformation(DicomAttributesToValidate dicomAttributesToValidate, int oneBasedLevel)
        {
            //
            // Determine the maximum amount of sequence items for all supplied sequence attributes.
            //

            int maxItemCount = dicomAttributesToValidate.MaxItemCount;

            //
            // Fill the table with the information.
            //

            for (int itemIndex = 1; itemIndex <= maxItemCount; itemIndex++)
            {
                //
                // Add begin item row.
                //

                NewRow();

                AddCommonInformationForBeginOrEndSequenceItems(oneBasedLevel, true, itemIndex);

                for (int attributeIndex = 0; attributeIndex < dicomAttributesToValidate.Count; attributeIndex++)
                {
                    AddAttributeInformationForBeginOrEndSequenceItem(dicomAttributesToValidate, attributeIndex, itemIndex, true);
                }

                //
                // Add the comparison of attributes within the sequence items.
                //

                ArrayList sequenceItemsToCompare = new ArrayList();
                ArrayList compareFlagsForSequenceItems = new ArrayList();
                ArrayList dicomAttributeFlagsForSequenceItems = new ArrayList();
                ArrayList displaySequenceItems = new ArrayList();

                for (int attributeSetsIndex = 0; attributeSetsIndex < dicomAttributesToValidate.Count; attributeSetsIndex++)
                {
                    DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[attributeSetsIndex] as DicomAttributeToValidate;
                    Attribute attribute = dicomAttributeToValidate.Attribute;

                    if (attribute is ValidAttribute)
                    {
                        if (attribute.VR == VR.SQ)
                        {
                            if ((dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags & DicomAttributeFlags.Include_sequence_items) == DicomAttributeFlags.Include_sequence_items)
                            {
                                if (attribute.ItemCount < itemIndex)
                                {
                                    // Add empty sequence item.
                                    sequenceItemsToCompare.Add(new SequenceItem());
                                }
                                else
                                {
                                    sequenceItemsToCompare.Add(attribute.GetItem(itemIndex));
                                }
                            }
                            else
                            {
                                // Add empty sequence item.
                                sequenceItemsToCompare.Add(new SequenceItem());
                            }
                        }
                        else
                        {
                            // Add empty sequence item.
                            sequenceItemsToCompare.Add(new SequenceItem());
                        }
                    }
                    else
                    {
                        // Add empty sequence item.
                        sequenceItemsToCompare.Add(new SequenceItem());
                    }

                    compareFlagsForSequenceItems.Add(dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags);
                    dicomAttributeFlagsForSequenceItems.Add(dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags & DicomAttributeFlags.Include_sequence_items);

                    if (dicomAttributeToValidate.Display)
                    {
                        displaySequenceItems.Add(true);
                    }
                    else
                    {
                        displaySequenceItems.Add(false);
                    }
                }

                AddAttributeSetsInformationUsingStaticCompare(sequenceItemsToCompare, compareFlagsForSequenceItems, dicomAttributeFlagsForSequenceItems, displaySequenceItems);

                //
                // Add end item row.
                //

                NewRow();

                AddCommonInformationForBeginOrEndSequenceItems(oneBasedLevel, false, itemIndex);

                for (int attributeIndex = 0; attributeIndex < dicomAttributesToValidate.Count; attributeIndex++)
                {
                    AddAttributeInformationForBeginOrEndSequenceItem(dicomAttributesToValidate, attributeIndex, itemIndex, false);
                }
            }
        }
Example #10
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        private void AddCommonInformationForAttributes(DicomAttributesToValidate dicomAttributesToValidate)
        {
            bool isLeadingAttributePresent = false;
            DicomAttributeToValidate leadingAttribute = dicomAttributesToValidate.LeadingAttribute;

            if (leadingAttribute.Attribute is ValidAttribute)
            {
                isLeadingAttributePresent = true;
            }
            else
            {
                isLeadingAttributePresent = false;
            }

            //
            // Fill in the common information.
            //

            // Common Tag column.
            if (this.displayCommonTag)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonTag, ((ValidAttribute)leadingAttribute.Attribute).TagSequence.DicomNotation);
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonTag);
                }
            }

            // Common Name column.
            if (this.displayCommonName)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonName, GetAttributeName(leadingAttribute.Attribute));
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonName);
                }
            }

            // Common VR column.
            if (this.displayCommonVR)
            {
                if (isLeadingAttributePresent)
                {
                    SetCellOK(this.columnIndexCommonVR, leadingAttribute.Attribute.VR.ToString());
                }
                else
                {
                    SetCellNotApplicable(this.columnIndexCommonVR);
                }
            }
        }
Example #11
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        private void AddAttributesInformation(DicomAttributesToValidate dicomAttributesToValidate)
        {
            NewRow();

            //
            // Fill in the common information.
            //

            AddCommonInformationForAttributes(dicomAttributesToValidate);

            //
            // Fill in the information specific for each attribute.
            //

            for (int index = 0; index < dicomAttributesToValidate.Count; index++)
            {
                AddAttributeInformationForAttribute(dicomAttributesToValidate, index);
            }

            //
            // If at least one attribute is a sequence attribute, do a comparison of the content.
            //

            if (dicomAttributesToValidate.ContainsSequenceAttribute)
            {
                // If a sequence attribute is present, also a leading attribute must be present of type ValidAttribute.
                int oneBasedLevel = (dicomAttributesToValidate.LeadingAttribute.Attribute as ValidAttribute).TagSequence.Tags.Count;

                // !!!!! DicomAttributesToValidate convertedToSequenceAttributes = dicomAttributesToValidate.ConvertedToSequenceAttributes;
                // !!!!! AddSequenceAttributesContentInformation(convertedToSequenceAttributes, oneBasedLevel);

                AddSequenceAttributesContentInformation(dicomAttributesToValidate, oneBasedLevel);
            }
        }
Example #12
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        private void AddAttributeInformationForBeginOrEndSequenceItem(DicomAttributesToValidate sequenceAttributes, int zeroBasedSequenceAttributesIndex, int sequenceItemIndex, bool isBeginItem)
        {
            DicomAttributeToValidate sequenceAttributeToValidate = sequenceAttributes[zeroBasedSequenceAttributesIndex] as DicomAttributeToValidate;

            if (this.displayAttributeTag)
            {
                int columnIndex = (int)this.columnIndexAttributeTag[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    if (sequenceAttributeToValidate.Attribute.VR == VR.SQ)
                    {
                        if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                        {
                            SetCellNotApplicable(columnIndex);
                        }
                        else
                        {
                            int level = (sequenceAttributeToValidate.Attribute as ValidAttribute).TagSequence.Tags.Count - 1;

                            SetCellOK(columnIndex, GetTagCellTextForBeginOrEndItem(level, isBeginItem));
                        }
                    }
                    else
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributeName)
            {
                int columnIndex = (int)this.columnIndexAttributeName[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                    else
                    {
                        SetCellOK(columnIndex, GetNameCellTextForBeginOrEndItem( sequenceItemIndex));
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributePresent)
            {
                int columnIndex = (int)this.columnIndexAttributePresent[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    String presentText = "";

                    if (sequenceAttributeToValidate.Attribute is ValidAttribute)
                    {
                        if (sequenceAttributeToValidate.Attribute.VR == VR.SQ)
                        {
                            if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                            {
                                presentText = "-";
                            }
                            else
                            {
                                presentText = "+";
                            }
                        }
                        else
                        {
                            presentText = "-";
                        }
                    }
                    else
                    {
                        presentText = "-";
                    }

                    if (sequenceAttributes.ContainsCompareSequenceItemsErrors(sequenceItemIndex))
                    {
                        SetCellError(columnIndex, presentText);
                    }
                    else
                    {
                        SetCellOK(columnIndex, presentText);
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributeVR)
            {
                int columnIndex = (int)this.columnIndexAttributeVR[zeroBasedSequenceAttributesIndex];

                SetCellNotApplicable(columnIndex);
            }

            if (this.displayAttributeValues)
            {
                int columnIndex = (int)this.columnIndexAttributeValues[zeroBasedSequenceAttributesIndex];

                SetCellNotApplicable(columnIndex);
            }
        }
Example #13
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        /// <param name="zeroBasedIndex">-</param>
        private void AddAttributeInformationForAttribute(DicomAttributesToValidate dicomAttributesToValidate, int zeroBasedIndex)
        {
            bool isAttributePresent = false;
            DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[zeroBasedIndex] as DicomAttributeToValidate;
            CompareFlags compareFlags = dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags;
            DicomAttributeFlags dicomAttributeFlags = dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags;

            if (dicomAttributeToValidate.Attribute is ValidAttribute)
            {
                isAttributePresent = true;
            }
            else
            {
                isAttributePresent = false;
            }

            // Attribute Tag column.
            if (this.displayAttributeTag)
            {
                if (isAttributePresent)
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.DisplayFullTagSequence)
                    {
                        ArrayList tags = (dicomAttributeToValidate.Attribute as ValidAttribute).TagSequence.Tags;

                        for (int tagIndex = 0; tagIndex < tags.Count; tagIndex++)
                        {
                            Tag tag = tags[tagIndex] as Tag;
                            if (tag.ContainsIndex)
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation + "(" + tag.IndexNumber + ")");
                            }
                            else
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation);
                            }
                        }
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], ((ValidAttribute)dicomAttributeToValidate.Attribute).TagSequence.DicomNotation);
                    }
                }
                else
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                    {
                        SetCellNotApplicable((int)this.columnIndexAttributeTag[zeroBasedIndex]);
                    }
                    else
                    {
                        TagSequence tagSequence = new TagSequence(dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence);
                        ArrayList tags = tagSequence.Tags;

                        for (int tagIndex = 0; tagIndex < tags.Count; tagIndex++)
                        {
                            Tag tag = tags[tagIndex] as Tag;
                            if (tag.ContainsIndex)
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation + "(" + tag.IndexNumber + ")");
                            }
                            else
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation);
                            }
                        }
                    }
                }
            }

            // Attribute Name column.
            if (this.displayAttributeName)
            {
                if (isAttributePresent)
                {
                    SetCellOK((int)this.columnIndexAttributeName[zeroBasedIndex], GetAttributeName(dicomAttributeToValidate.Attribute));
                }
                else
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                    {
                        SetCellNotApplicable((int)this.columnIndexAttributeName[zeroBasedIndex]);
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeName[zeroBasedIndex], "-");
                    }
                }
            }

            // Attribute Present column.
            if (this.displayAttributePresent)
            {
                if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                {
                    SetCellNotApplicable((int)this.columnIndexAttributePresent[zeroBasedIndex]);
                }
                else
                {
                    String presentString = "";
                    bool containsError = false;

                    if (isAttributePresent)
                    {
                        presentString = "+";
                    }
                    else
                    {
                        presentString = "-";
                    }

                    if ((compareFlags & CompareFlags.Compare_present) == CompareFlags.Compare_present)
                    {
                        if (dicomAttributesToValidate.ContainsComparePresentErrors)
                        {
                            containsError = true;
                        }
                    }

                    if ((dicomAttributeFlags & DicomAttributeFlags.Present) == DicomAttributeFlags.Present)
                    {
                        if (!isAttributePresent)
                        {
                            containsError = true;
                        }
                    }

                    if ((dicomAttributeFlags & DicomAttributeFlags.Not_present) == DicomAttributeFlags.Not_present)
                    {
                        if (isAttributePresent)
                        {
                            containsError = true;
                        }
                    }

                    if (containsError)
                    {
                        SetCellError((int)this.columnIndexAttributePresent[zeroBasedIndex], presentString);
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributePresent[zeroBasedIndex], presentString);
                    }
                }
            }

            // Attribute VR column.
            if (this.displayAttributeVR)
            {
                if (isAttributePresent)
                {
                    bool containsError = false;

                    if ((compareFlags & CompareFlags.Compare_VR) == CompareFlags.Compare_VR)
                    {
                        if (dicomAttributesToValidate.ContainsCompareVRErrors)
                        {
                            containsError = true;
                        }
                    }

                    if (containsError)
                    {
                        SetCellError((int)this.columnIndexAttributeVR[zeroBasedIndex], dicomAttributeToValidate.Attribute.VR.ToString());
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeVR[zeroBasedIndex], dicomAttributeToValidate.Attribute.VR.ToString());
                    }
                }
                else
                {
                    SetCellNotApplicable((int)this.columnIndexAttributeVR[zeroBasedIndex]);
                }
            }

            // Attribute Values column.
            if (this.displayAttributeValues)
            {
                int columnIndex = (int)this.columnIndexAttributeValues[zeroBasedIndex];

                if (isAttributePresent)
                {
                    if (dicomAttributeToValidate.Attribute.VR == VR.SQ)
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                    else
                    {
                        bool containsError = false;

                        if ((compareFlags & CompareFlags.Compare_values) == CompareFlags.Compare_values)
                        {
                            if (dicomAttributesToValidate.ContainsCompareValuesErrors)
                            {
                                containsError = true;
                            }
                        }

                        if ((dicomAttributeFlags & DicomAttributeFlags.Values) == DicomAttributeFlags.Values)
                        {
                            if (dicomAttributeToValidate.Attribute.Values.Count == 0)
                            {
                                containsError = true;
                            }
                        }

                        if ((dicomAttributeFlags & DicomAttributeFlags.No_values) == DicomAttributeFlags.No_values)
                        {
                            if (dicomAttributeToValidate.Attribute.Values.Count > 0)
                            {
                                containsError = true;
                            }
                        }

                        if (containsError)
                        {
                            SetCellError(columnIndex, dicomAttributeToValidate.Attribute.Values.ToString());
                        }
                        else
                        {
                            SetCellOK(columnIndex, dicomAttributeToValidate.Attribute.Values.ToString());
                        }
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }
        }
Example #14
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        private void AddAttributeInformationForBeginOrEndSequenceItem(DicomAttributesToValidate sequenceAttributes, int zeroBasedSequenceAttributesIndex, int sequenceItemIndex, bool isBeginItem)
        {
            DicomAttributeToValidate sequenceAttributeToValidate = sequenceAttributes[zeroBasedSequenceAttributesIndex] as DicomAttributeToValidate;

            if (this.displayAttributeTag)
            {
                int columnIndex = (int)this.columnIndexAttributeTag[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    if (sequenceAttributeToValidate.Attribute.VR == VR.SQ)
                    {
                        if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                        {
                            SetCellNotApplicable(columnIndex);
                        }
                        else
                        {
                            int level = (sequenceAttributeToValidate.Attribute as ValidAttribute).TagSequence.Tags.Count - 1;

                            SetCellOK(columnIndex, GetTagCellTextForBeginOrEndItem(level, isBeginItem));
                        }
                    }
                    else
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributeName)
            {
                int columnIndex = (int)this.columnIndexAttributeName[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                    else
                    {
                        SetCellOK(columnIndex, GetNameCellTextForBeginOrEndItem(sequenceItemIndex));
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributePresent)
            {
                int columnIndex = (int)this.columnIndexAttributePresent[zeroBasedSequenceAttributesIndex];

                if (sequenceAttributeToValidate.Display)
                {
                    String presentText = "";

                    if (sequenceAttributeToValidate.Attribute is ValidAttribute)
                    {
                        if (sequenceAttributeToValidate.Attribute.VR == VR.SQ)
                        {
                            if (sequenceItemIndex > sequenceAttributeToValidate.Attribute.ItemCount)
                            {
                                presentText = "-";
                            }
                            else
                            {
                                presentText = "+";
                            }
                        }
                        else
                        {
                            presentText = "-";
                        }
                    }
                    else
                    {
                        presentText = "-";
                    }

                    if (sequenceAttributes.ContainsCompareSequenceItemsErrors(sequenceItemIndex))
                    {
                        SetCellError(columnIndex, presentText);
                    }
                    else
                    {
                        SetCellOK(columnIndex, presentText);
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }

            if (this.displayAttributeVR)
            {
                int columnIndex = (int)this.columnIndexAttributeVR[zeroBasedSequenceAttributesIndex];

                SetCellNotApplicable(columnIndex);
            }

            if (this.displayAttributeValues)
            {
                int columnIndex = (int)this.columnIndexAttributeValues[zeroBasedSequenceAttributesIndex];

                SetCellNotApplicable(columnIndex);
            }
        }
Example #15
0
        /// <summary>
        /// Obsolete class, use the classes in the namespace DvtkHighLevelInterface.Common.Compare instead.
        /// </summary>
        /// <param name="dicomAttributesToValidate">-</param>
        /// <param name="zeroBasedIndex">-</param>
        private void AddAttributeInformationForAttribute(DicomAttributesToValidate dicomAttributesToValidate, int zeroBasedIndex)
        {
            bool isAttributePresent = false;
            DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[zeroBasedIndex] as DicomAttributeToValidate;
            CompareFlags             compareFlags             = dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags;
            DicomAttributeFlags      dicomAttributeFlags      = dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags;

            if (dicomAttributeToValidate.Attribute is ValidAttribute)
            {
                isAttributePresent = true;
            }
            else
            {
                isAttributePresent = false;
            }

            // Attribute Tag column.
            if (this.displayAttributeTag)
            {
                if (isAttributePresent)
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.DisplayFullTagSequence)
                    {
                        ArrayList tags = (dicomAttributeToValidate.Attribute as ValidAttribute).TagSequence.Tags;

                        for (int tagIndex = 0; tagIndex < tags.Count; tagIndex++)
                        {
                            Tag tag = tags[tagIndex] as Tag;
                            if (tag.ContainsIndex)
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation + "(" + tag.IndexNumber + ")");
                            }
                            else
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation);
                            }
                        }
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], ((ValidAttribute)dicomAttributeToValidate.Attribute).TagSequence.DicomNotation);
                    }
                }
                else
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                    {
                        SetCellNotApplicable((int)this.columnIndexAttributeTag[zeroBasedIndex]);
                    }
                    else
                    {
                        TagSequence tagSequence = new TagSequence(dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence);
                        ArrayList   tags        = tagSequence.Tags;

                        for (int tagIndex = 0; tagIndex < tags.Count; tagIndex++)
                        {
                            Tag tag = tags[tagIndex] as Tag;
                            if (tag.ContainsIndex)
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation + "(" + tag.IndexNumber + ")");
                            }
                            else
                            {
                                SetCellOK((int)this.columnIndexAttributeTag[zeroBasedIndex], "".PadRight(tagIndex, '>') + tag.DicomNotation);
                            }
                        }
                    }
                }
            }

            // Attribute Name column.
            if (this.displayAttributeName)
            {
                if (isAttributePresent)
                {
                    SetCellOK((int)this.columnIndexAttributeName[zeroBasedIndex], GetAttributeName(dicomAttributeToValidate.Attribute));
                }
                else
                {
                    if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                    {
                        SetCellNotApplicable((int)this.columnIndexAttributeName[zeroBasedIndex]);
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeName[zeroBasedIndex], "-");
                    }
                }
            }


            // Attribute Present column.
            if (this.displayAttributePresent)
            {
                if (dicomAttributeToValidate.ValidationRuleDicomAttribute.TagSequence == "")
                {
                    SetCellNotApplicable((int)this.columnIndexAttributePresent[zeroBasedIndex]);
                }
                else
                {
                    String presentString = "";
                    bool   containsError = false;

                    if (isAttributePresent)
                    {
                        presentString = "+";
                    }
                    else
                    {
                        presentString = "-";
                    }

                    if ((compareFlags & CompareFlags.Compare_present) == CompareFlags.Compare_present)
                    {
                        if (dicomAttributesToValidate.ContainsComparePresentErrors)
                        {
                            containsError = true;
                        }
                    }

                    if ((dicomAttributeFlags & DicomAttributeFlags.Present) == DicomAttributeFlags.Present)
                    {
                        if (!isAttributePresent)
                        {
                            containsError = true;
                        }
                    }

                    if ((dicomAttributeFlags & DicomAttributeFlags.Not_present) == DicomAttributeFlags.Not_present)
                    {
                        if (isAttributePresent)
                        {
                            containsError = true;
                        }
                    }

                    if (containsError)
                    {
                        SetCellError((int)this.columnIndexAttributePresent[zeroBasedIndex], presentString);
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributePresent[zeroBasedIndex], presentString);
                    }
                }
            }

            // Attribute VR column.
            if (this.displayAttributeVR)
            {
                if (isAttributePresent)
                {
                    bool containsError = false;

                    if ((compareFlags & CompareFlags.Compare_VR) == CompareFlags.Compare_VR)
                    {
                        if (dicomAttributesToValidate.ContainsCompareVRErrors)
                        {
                            containsError = true;
                        }
                    }

                    if (containsError)
                    {
                        SetCellError((int)this.columnIndexAttributeVR[zeroBasedIndex], dicomAttributeToValidate.Attribute.VR.ToString());
                    }
                    else
                    {
                        SetCellOK((int)this.columnIndexAttributeVR[zeroBasedIndex], dicomAttributeToValidate.Attribute.VR.ToString());
                    }
                }
                else
                {
                    SetCellNotApplicable((int)this.columnIndexAttributeVR[zeroBasedIndex]);
                }
            }

            // Attribute Values column.
            if (this.displayAttributeValues)
            {
                int columnIndex = (int)this.columnIndexAttributeValues[zeroBasedIndex];

                if (isAttributePresent)
                {
                    if (dicomAttributeToValidate.Attribute.VR == VR.SQ)
                    {
                        SetCellNotApplicable(columnIndex);
                    }
                    else
                    {
                        bool containsError = false;

                        if ((compareFlags & CompareFlags.Compare_values) == CompareFlags.Compare_values)
                        {
                            if (dicomAttributesToValidate.ContainsCompareValuesErrors)
                            {
                                containsError = true;
                            }
                        }

                        if ((dicomAttributeFlags & DicomAttributeFlags.Values) == DicomAttributeFlags.Values)
                        {
                            if (dicomAttributeToValidate.Attribute.Values.Count == 0)
                            {
                                containsError = true;
                            }
                        }

                        if ((dicomAttributeFlags & DicomAttributeFlags.No_values) == DicomAttributeFlags.No_values)
                        {
                            if (dicomAttributeToValidate.Attribute.Values.Count > 0)
                            {
                                containsError = true;
                            }
                        }

                        if (containsError)
                        {
                            SetCellError(columnIndex, dicomAttributeToValidate.Attribute.Values.ToString());
                        }
                        else
                        {
                            SetCellOK(columnIndex, dicomAttributeToValidate.Attribute.Values.ToString());
                        }
                    }
                }
                else
                {
                    SetCellNotApplicable(columnIndex);
                }
            }
        }
Example #16
0
        private void AddSequenceAttributesContentInformation(DicomAttributesToValidate dicomAttributesToValidate, int oneBasedLevel)
        {
            //
            // Determine the maximum amount of sequence items for all supplied sequence attributes.
            //

            int maxItemCount = dicomAttributesToValidate.MaxItemCount;


            //
            // Fill the table with the information.
            //

            for (int itemIndex = 1; itemIndex <= maxItemCount; itemIndex++)
            {
                //
                // Add begin item row.
                //

                NewRow();

                AddCommonInformationForBeginOrEndSequenceItems(oneBasedLevel, true, itemIndex);

                for (int attributeIndex = 0; attributeIndex < dicomAttributesToValidate.Count; attributeIndex++)
                {
                    AddAttributeInformationForBeginOrEndSequenceItem(dicomAttributesToValidate, attributeIndex, itemIndex, true);
                }


                //
                // Add the comparison of attributes within the sequence items.
                //

                ArrayList sequenceItemsToCompare              = new ArrayList();
                ArrayList compareFlagsForSequenceItems        = new ArrayList();
                ArrayList dicomAttributeFlagsForSequenceItems = new ArrayList();
                ArrayList displaySequenceItems = new ArrayList();

                for (int attributeSetsIndex = 0; attributeSetsIndex < dicomAttributesToValidate.Count; attributeSetsIndex++)
                {
                    DicomAttributeToValidate dicomAttributeToValidate = dicomAttributesToValidate[attributeSetsIndex] as DicomAttributeToValidate;
                    Attribute attribute = dicomAttributeToValidate.Attribute;

                    if (attribute is ValidAttribute)
                    {
                        if (attribute.VR == VR.SQ)
                        {
                            if ((dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags & DicomAttributeFlags.Include_sequence_items) == DicomAttributeFlags.Include_sequence_items)
                            {
                                if (attribute.ItemCount < itemIndex)
                                {
                                    // Add empty sequence item.
                                    sequenceItemsToCompare.Add(new SequenceItem());
                                }
                                else
                                {
                                    sequenceItemsToCompare.Add(attribute.GetItem(itemIndex));
                                }
                            }
                            else
                            {
                                // Add empty sequence item.
                                sequenceItemsToCompare.Add(new SequenceItem());
                            }
                        }
                        else
                        {
                            // Add empty sequence item.
                            sequenceItemsToCompare.Add(new SequenceItem());
                        }
                    }
                    else
                    {
                        // Add empty sequence item.
                        sequenceItemsToCompare.Add(new SequenceItem());
                    }

                    compareFlagsForSequenceItems.Add(dicomAttributeToValidate.ValidationRuleDicomAttribute.CompareFlags);
                    dicomAttributeFlagsForSequenceItems.Add(dicomAttributeToValidate.ValidationRuleDicomAttribute.DicomAttributeFlags & DicomAttributeFlags.Include_sequence_items);

                    if (dicomAttributeToValidate.Display)
                    {
                        displaySequenceItems.Add(true);
                    }
                    else
                    {
                        displaySequenceItems.Add(false);
                    }
                }

                AddAttributeSetsInformationUsingStaticCompare(sequenceItemsToCompare, compareFlagsForSequenceItems, dicomAttributeFlagsForSequenceItems, displaySequenceItems);


                //
                // Add end item row.
                //

                NewRow();

                AddCommonInformationForBeginOrEndSequenceItems(oneBasedLevel, false, itemIndex);

                for (int attributeIndex = 0; attributeIndex < dicomAttributesToValidate.Count; attributeIndex++)
                {
                    AddAttributeInformationForBeginOrEndSequenceItem(dicomAttributesToValidate, attributeIndex, itemIndex, false);
                }
            }
        }