/// <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); }
// // - 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); }
// // - 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); }
/// <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); }