コード例 #1
0
ファイル: DimseDataClasses.cs プロジェクト: ewcasas/DVTK
        private void _InitializeAttribute(
            GROUP_NUMBER groupNumber,
            ELEMENT_NUMBER elementNumber,
            VR vr,
            params object[] list)
        {
            this.Tag.GroupNumber = groupNumber;
            this.Tag.ElementNumber = elementNumber;
            DicomValueType dicomValue = null;
            if(list!= null)
            {
                switch (vr)
                {
                    case VR.AE:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        ApplicationEntity applicationEntity = new ApplicationEntity();
                        applicationEntity.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = applicationEntity;

                        // compute attribute value length
                        Length = 0;
                        if (applicationEntity.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in applicationEntity.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)applicationEntity.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.AS:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        AgeString ageString = new AgeString();
                        ageString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = ageString;

                        // compute attribute value length
                        Length = (System.UInt32)ageString.Values.Count * 4;
                        break;
                    }
                    case VR.AT:
                    {
                        Tag[] tagArray = _CastToTagArray(list);
                        AttributeTag attributeTag = new AttributeTag();
                        attributeTag.Values =
                            new DvtkData.Collections.TagCollection(tagArray);
                        dicomValue = attributeTag;

                        // compute attribute value length
                        Length = (System.UInt32)attributeTag.Values.Count * 4;
                        break;
                    }
                    case VR.CS:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        CodeString codeString = new CodeString();
                        codeString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = codeString;

                        // compute attribute value length
                        Length = 0;
                        if (codeString.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in codeString.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)codeString.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.DA:
                    {
                        System.String[] stringArray = _CastToDateStringArray(list);
                        Date date = new Date();
                        date.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = date;

                        // compute attribute value length
                        Length = 0;
                        if (date.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in date.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length;
                        }
                        break;
                    }
                    case VR.DS:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        DecimalString decimalString = new DecimalString();
                        decimalString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = decimalString;

                        // compute attribute value length
                        Length = 0;
                        if (decimalString.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in decimalString.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)decimalString.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.DT:
                    {
                        System.String[] stringArray = _CastToDateTimeStringArray(list);
                        DateTime dateTime = new DateTime();
                        dateTime.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = dateTime;

                        // compute attribute value length
                        Length = 0;
                        if (dateTime.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in dateTime.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)dateTime.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.FD:
                    {
                        System.Double[] floatingPointDoubleArray = _CastToFloatingPointDoubleArray(list);
                        FloatingPointDouble floatingPointDouble = new FloatingPointDouble();
                        floatingPointDouble.Values =
                            new DvtkData.Collections.DoubleCollection(floatingPointDoubleArray);
                        dicomValue = floatingPointDouble;

                        // compute attribute value length
                        Length = (System.UInt32)floatingPointDouble.Values.Count * 8;
                        break;
                    }
                    case VR.FL:
                    {
                        System.Single[] floatingPointSingleArray = _CastToFloatingPointSingleArray(list);
                        FloatingPointSingle floatingPointSingle = new FloatingPointSingle();
                        floatingPointSingle.Values =
                            new DvtkData.Collections.SingleCollection(floatingPointSingleArray);
                        dicomValue = floatingPointSingle;

                        // compute attribute value length
                        Length = (System.UInt32)floatingPointSingle.Values.Count * 4;
                        break;
                    }
                    case VR.IS:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        IntegerString integerString = new IntegerString();
                        integerString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = integerString;

                        // compute attribute value length
                        Length = 0;
                        if (integerString.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in integerString.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)integerString.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.LO:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        LongString longString = new LongString();
                        longString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = longString;

                        // compute attribute value length
                        Length = 0;
                        if (longString.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in longString.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)longString.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.LT:
                    {
                        if (list.Length > 1) throw new System.ArgumentException();
                        LongText longText = new LongText();
                        Length = 0;
                        if (list.Length == 1)
                        {
                            System.String stringValue = System.Convert.ToString(list[0]);
                            longText.Value = stringValue;
                            Length = (System.UInt32)stringValue.Length;
                        }
                        dicomValue = longText;
                        break;
                    }
                    case VR.OB:
                    {
                        OtherByteString otherByteString = new OtherByteString();
                        if (list.Length > 0)
                        {
                            if (list.Length == 1 && list[0] is System.String)
                            {
                                otherByteString.FileName = (System.String)list[0];
                                Length = (System.UInt32)otherByteString.FileName.Length;
                            }
                            else if (list.Length == 1 && list[0] is BitmapPatternParameters)
                            {
                                otherByteString.BitmapPattern = (BitmapPatternParameters)list[0];
                            }
                            else if (list.Length > 0 && list.Length <= 7)
                            {
                                BitmapPatternParameters pattern = new BitmapPatternParameters();
                                try
                                {
                                    int listLength = list.Length;
                                    if (listLength > 0)
                                    {
                                        pattern.NumberOfRows = System.Convert.ToUInt16(list[0]);
                                        if (listLength == 1) pattern.NumberOfColumns = pattern.NumberOfRows;
                                    }
                                    if (listLength > 1) pattern.NumberOfColumns = System.Convert.ToUInt16(list[1]);
                                    if (listLength > 2) pattern.StartValue = System.Convert.ToInt16(list[2]);
                                    if (listLength > 3) pattern.ValueIncrementPerRowBlock = System.Convert.ToInt16(list[3]);
                                    if (listLength > 4) pattern.ValueIncrementPerColumnBlock = System.Convert.ToInt16(list[4]);
                                    if (listLength > 5) pattern.NumberOfIdenticalValueRows = System.Convert.ToUInt16(list[5]);
                                    if (listLength > 6) pattern.NumberOfIdenticalValueColumns = System.Convert.ToUInt16(list[6]);
                                }
                                catch
                                {
                                    throw new System.ArgumentException();
                                }
                                otherByteString.BitmapPattern = pattern;
                            }
                            else throw new System.ArgumentException();
                        }
                        dicomValue = otherByteString;
                        break;
                    }
                    case VR.OF:
                    {
                        OtherFloatString otherFloatString = new OtherFloatString();
                        if (list.Length > 0)
                        {
                            if (list.Length == 1 && list[0] is System.String)
                            {
                                otherFloatString.FileName = (System.String)list[0];
                                Length = (System.UInt32)otherFloatString.FileName.Length;
                            }
                            else if (list.Length == 1 && list[0] is BitmapPatternParameters)
                            {
                                otherFloatString.BitmapPattern = (BitmapPatternParameters)list[0];
                            }
                            else if (list.Length > 0 && list.Length <= 7)
                            {
                                BitmapPatternParameters pattern = new BitmapPatternParameters();
                                try
                                {
                                    int listLength = list.Length;
                                    if (listLength > 0)
                                    {
                                        pattern.NumberOfRows = System.Convert.ToUInt16(list[0]);
                                        if (listLength == 1) pattern.NumberOfColumns = pattern.NumberOfRows;
                                    }
                                    if (listLength > 1) pattern.NumberOfColumns = System.Convert.ToUInt16(list[1]);
                                    if (listLength > 2) pattern.StartValue = System.Convert.ToInt16(list[2]);
                                    if (listLength > 3) pattern.ValueIncrementPerRowBlock = System.Convert.ToInt16(list[3]);
                                    if (listLength > 4) pattern.ValueIncrementPerColumnBlock = System.Convert.ToInt16(list[4]);
                                    if (listLength > 5) pattern.NumberOfIdenticalValueRows = System.Convert.ToUInt16(list[5]);
                                    if (listLength > 6) pattern.NumberOfIdenticalValueColumns = System.Convert.ToUInt16(list[6]);
                                }
                                catch
                                {
                                    throw new System.ArgumentException();
                                }
                                otherFloatString.BitmapPattern = pattern;
                            }
                            else throw new System.ArgumentException();
                        }
                        dicomValue = otherFloatString;
                        break;
                    }
                    case VR.OW:
                    {
                        OtherWordString otherWordString = new OtherWordString();
                        if (list.Length > 0)
                        {
                            if (list.Length == 1 && list[0] is System.String)
                            {
                                otherWordString.FileName = (System.String)list[0];
                                Length = (System.UInt32)otherWordString.FileName.Length;
                            }
                            else if (list.Length == 1 && list[0] is BitmapPatternParameters)
                            {
                                otherWordString.BitmapPattern = (BitmapPatternParameters)list[0];
                            }
                            else if (list.Length > 0 && list.Length <= 7)
                            {
                                BitmapPatternParameters pattern = new BitmapPatternParameters();
                                try
                                {
                                    int listLength = list.Length;
                                    if (listLength > 0)
                                    {
                                        pattern.NumberOfRows = System.Convert.ToUInt16(list[0]);
                                        if (listLength == 1) pattern.NumberOfColumns = pattern.NumberOfRows;
                                    }
                                    if (listLength > 1) pattern.NumberOfColumns = System.Convert.ToUInt16(list[1]);
                                    if (listLength > 2) pattern.StartValue = System.Convert.ToInt16(list[2]);
                                    if (listLength > 3) pattern.ValueIncrementPerRowBlock = System.Convert.ToInt16(list[3]);
                                    if (listLength > 4) pattern.ValueIncrementPerColumnBlock = System.Convert.ToInt16(list[4]);
                                    if (listLength > 5) pattern.NumberOfIdenticalValueRows = System.Convert.ToUInt16(list[5]);
                                    if (listLength > 6) pattern.NumberOfIdenticalValueColumns = System.Convert.ToUInt16(list[6]);
                                }
                                catch
                                {
                                    throw new System.ArgumentException();
                                }
                                otherWordString.BitmapPattern = pattern;
                            }
                            else throw new System.ArgumentException();
                        }
                        dicomValue = otherWordString;
                        break;
                    }
                    case VR.PN:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        PersonName personName = new PersonName();
                        personName.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = personName;

                        // compute attribute value length
                        Length = 0;
                        if (personName.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in personName.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)personName.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.SH:
                    {
                        System.String[] stringArray = _CastToStringArray(list);
                        ShortString shortString = new ShortString();
                        shortString.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = shortString;

                        // compute attribute value length
                        Length = 0;
                        if (shortString.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in shortString.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)shortString.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.SL:
                    {
                        System.Int32[] signedLongArray = _CastToSignedLongArray(list);
                        SignedLong signedLong = new SignedLong();
                        signedLong.Values =
                            new DvtkData.Collections.Int32Collection(signedLongArray);
                        dicomValue = signedLong;

                        // compute attribute value length
                        Length = (System.UInt32)signedLong.Values.Count * 4;
                        break;
                    }
                    case VR.SQ:
                    {
                        SequenceItem[] sequenceItemArray = _CastToSequenceItemArray(list);
                        SequenceOfItems sequenceOfItems = new SequenceOfItems();
                        sequenceOfItems.Sequence = new Sequence();
                        foreach (SequenceItem item in sequenceItemArray)
                        {
                            sequenceOfItems.Sequence.Add(item);
                        }
                        dicomValue = sequenceOfItems;

                        // set length to Undefined
                        Length = 0xFFFFFFFF;
                        break;
                    }
                    case VR.SS:
                    {
                        System.Int16[] signedShortArray = _CastToSignedShortArray(list);
                        SignedShort signedShort = new SignedShort();
                        signedShort.Values =
                            new DvtkData.Collections.Int16Collection(signedShortArray);
                        dicomValue = signedShort;

                        // compute attribute value length
                        Length = (System.UInt32)signedShort.Values.Count * 2;
                        break;
                    }
                    case VR.ST:
                    {
                        if (list.Length > 1) throw new System.ArgumentException();
                        ShortText shortText = new ShortText();
                        Length = 0;
                        if (list.Length == 1)
                        {
                            System.String stringValue = System.Convert.ToString(list[0]);
                            shortText.Value = stringValue;
                            Length = (System.UInt32)shortText.Value.Length;
                        }
                        dicomValue = shortText;
                        break;
                    }
                    case VR.TM:
                    {
                        System.String[] stringArray = _CastToTimeStringArray(list);
                        Time time = new Time();
                        time.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = time;

                        // compute attribute value length
                        Length = 0;
                        if (time.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in time.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)time.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.UI:
                    {
                        System.String[] stringArray = _CastUniqueIdentifierStringArray(list);
                        UniqueIdentifier uniqueIdentifier = new UniqueIdentifier();
                        uniqueIdentifier.Values =
                            new DvtkData.Collections.StringCollection(stringArray);
                        dicomValue = uniqueIdentifier;

                        // compute attribute value length
                        Length = 0;
                        if (uniqueIdentifier.Values.Count > 0)
                        {
                            System.UInt32 length = 0;
                            foreach(String data in uniqueIdentifier.Values)
                            {
                                length += (System.UInt32)data.Length;
                            }
                            Length = length + (System.UInt32)uniqueIdentifier.Values.Count - 1;
                        }
                        break;
                    }
                    case VR.UL:
                    {
                        System.UInt32[] unsignedLongArray = _CastToUnsignedLongArray(list);
                        UnsignedLong unsignedLong = new UnsignedLong();
                        unsignedLong.Values =
                            new DvtkData.Collections.UInt32Collection(unsignedLongArray);
                        dicomValue = unsignedLong;

                        // compute attribute value length
                        Length = (System.UInt32)unsignedLong.Values.Count * 4;
                        break;
                    }
                    case VR.UN:
                    {
                        Unknown unknown = new Unknown();
                        Length = 0;
                        if (list.Length == 0 ||
                            list[0] is System.Byte)
                        {
                            System.Byte[] byteArray = _CastToByteArray(list);
                            unknown.ByteArray = byteArray;
                            Length = (System.UInt32)unknown.ByteArray.Length;
                        }
                        else throw new System.ArgumentException();
                        dicomValue = unknown;
                        break;
                    }
                    case VR.US:
                    {
                        System.UInt16[] unsignedShortArray = _CastToUnsignedShortArray(list);
                        UnsignedShort unsignedShort = new UnsignedShort();
                        unsignedShort.Values =
                            new DvtkData.Collections.UInt16Collection(unsignedShortArray);
                        dicomValue = unsignedShort;

                        // compute attribute value length
                        Length = (System.UInt32)unsignedShort.Values.Count * 2;
                        break;
                    }
                    case VR.UT:
                    {
                        if (list.Length > 1) throw new System.ArgumentException();
                        UnlimitedText unlimitedText = new UnlimitedText();
                        Length = 0;
                        if (list.Length == 1)
                        {
                            System.String stringValue = System.Convert.ToString(list[0]);
                            unlimitedText.Value = stringValue;
                            Length = (System.UInt32)unlimitedText.Value.Length;
                        }
                        dicomValue = unlimitedText;
                        break;
                    }
                    default:
                        dicomValue = null;
                        break;
                }
            }
            else
            {
                dicomValue = null;
            }
            this._ValueField = dicomValue;
        }
コード例 #2
0
ファイル: BaseInformationEntity.cs プロジェクト: ewcasas/DVTK
        bool CompareSeqence(VR vr,DicomValueType thisAttribValue,DicomValueType matchAttribValue )
        {
            bool isFound = true;
            switch (vr)
            {
                case VR.AE:
                    {
                        ApplicationEntity thisApplicationEntity = (ApplicationEntity)thisAttribValue;
                        ApplicationEntity matchApplicationEntity = (ApplicationEntity)matchAttribValue;
                        if (thisApplicationEntity.Values.Count != matchApplicationEntity.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisApplicationEntity.Values.Count; i++)
                            {
                                if (!WildCardMatchString(matchApplicationEntity.Values[i], thisApplicationEntity.Values[i], IsCaseSensitiveAE))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.AS:
                    {
                        AgeString thisAgeString = (AgeString)thisAttribValue;
                        AgeString matchAgeString = (AgeString)matchAttribValue;
                        if (thisAgeString.Values.Count != matchAgeString.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisAgeString.Values.Count; i++)
                            {
                                if (!MatchString(matchAgeString.Values[i], thisAgeString.Values[i]))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.AT:
                    {
                        AttributeTag thisAttributeTag = (AttributeTag)thisAttribValue;
                        AttributeTag matchAttributeTag = (AttributeTag)matchAttribValue;
                        if (thisAttributeTag.Values.Count != matchAttributeTag.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisAttributeTag.Values.Count; i++)
                            {
                                if (matchAttributeTag.Values[i] != thisAttributeTag.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.CS:
                    {
                        CodeString thisCodeString = (CodeString)thisAttribValue;
                        CodeString matchCodeString = (CodeString)matchAttribValue;
                        //if (thisCodeString.Values.Count != matchCodeString.Values.Count)
                        //{
                        //    isFound = false;
                        //}
                        //else
                        //{
                        //    for (int i = 0; i < thisCodeString.Values.Count; i++)
                        //    {
                        //        if (!WildCardMatchString(matchCodeString.Values[i], thisCodeString.Values[i], IsCaseSensitiveCS))
                        //        {
                        //            isFound = false;
                        //            break;
                        //        }
                        //    }
                        //}
                        isFound = false;
                        for (int i = 0; i < thisCodeString.Values.Count; i++)
                        {
                            for (int j = 0; j < matchCodeString.Values.Count; j++)
                            {
                                if (WildCardMatchString(matchCodeString.Values[j], thisCodeString.Values[i], IsCaseSensitiveCS))
                                {
                                    isFound = true;
                                    break;
                                }
                            }
                        }

                        break;
                    }
                case VR.DA:
                    {
                        Date thisDate = (Date)thisAttribValue;
                        Date matchDate = (Date)matchAttribValue;
                        if (thisDate.Values.Count != matchDate.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisDate.Values.Count; i++)
                            {
                                System.String thisDateString = thisDate.Values[i].Trim();
                                System.String matchDateString = matchDate.Values[i].Trim();
                                switch (matchDateString.Length)
                                {
                                    case 9:
                                        // ToDate = -YYYYMMDD
                                        // FromDate = YYYYMMDD-
                                        if (matchDateString.StartsWith("-"))
                                        {
                                            System.String date = matchDateString.Substring(1, 8);
                                            int comparison = thisDateString.CompareTo(date);
                                            if (comparison > 0)
                                            {
                                                isFound = false;
                                            }
                                        }
                                        else if (matchDateString.EndsWith("-"))
                                        {
                                            System.String date = matchDateString.Substring(0, 8);
                                            int comparison = thisDateString.CompareTo(date);
                                            if (comparison < 0)
                                            {
                                                isFound = false;
                                            }
                                        }
                                        break;
                                    case 17:
                                        // DateRange = YYYYMMDD-YYYYMMDD
                                        System.String[] dates = matchDateString.Split('-');
                                        int comparison1 = thisDateString.CompareTo(dates[0]);
                                        int comparison2 = thisDateString.CompareTo(dates[1]);
                                        if ((comparison1 < 0) ||
                                            (comparison2 > 0))
                                        {
                                            isFound = false;
                                        }
                                        break;
                                    case 8:
                                    // Date = YYYYMMDD
                                    default:
                                        if (!MatchString(matchDateString, thisDateString))
                                        {
                                            isFound = false;
                                        }
                                        break;
                                }

                                if (isFound == false)
                                {
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.DS:
                    {
                        DecimalString thisDecimalString = (DecimalString)thisAttribValue;
                        DecimalString matchDecimalString = (DecimalString)matchAttribValue;
                        if (thisDecimalString.Values.Count != matchDecimalString.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisDecimalString.Values.Count; i++)
                            {
                                if (!MatchString(matchDecimalString.Values[i], thisDecimalString.Values[i]))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.DT:
                    {
                        DvtkData.Dimse.DateTime thisDateTime = (DvtkData.Dimse.DateTime)thisAttribValue;
                        DvtkData.Dimse.DateTime matchDateTime = (DvtkData.Dimse.DateTime)matchAttribValue;
                        if (thisDateTime.Values.Count != matchDateTime.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisDateTime.Values.Count; i++)
                            {
                                if (!MatchString(matchDateTime.Values[i], thisDateTime.Values[i]))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.FD:
                    {
                        FloatingPointDouble thisFloatingPointDouble = (FloatingPointDouble)thisAttribValue;
                        FloatingPointDouble matchFloatingPointDouble = (FloatingPointDouble)matchAttribValue;
                        if (thisFloatingPointDouble.Values.Count != matchFloatingPointDouble.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisFloatingPointDouble.Values.Count; i++)
                            {
                                if (matchFloatingPointDouble.Values[i] != thisFloatingPointDouble.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.FL:
                    {
                        FloatingPointSingle thisFloatingPointSingle = (FloatingPointSingle)thisAttribValue;
                        FloatingPointSingle matchFloatingPointSingle = (FloatingPointSingle)matchAttribValue;
                        if (thisFloatingPointSingle.Values.Count != matchFloatingPointSingle.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisFloatingPointSingle.Values.Count; i++)
                            {
                                if (matchFloatingPointSingle.Values[i] != thisFloatingPointSingle.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.IS:
                    {
                        IntegerString thisIntegerString = (IntegerString)thisAttribValue;
                        IntegerString matchIntegerString = (IntegerString)matchAttribValue;
                        if (thisIntegerString.Values.Count != matchIntegerString.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisIntegerString.Values.Count; i++)
                            {
                                if (!MatchString(matchIntegerString.Values[i], thisIntegerString.Values[i]))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.LO:
                    {
                        LongString thisLongString = (LongString)thisAttribValue;
                        LongString matchLongString = (LongString)matchAttribValue;
                        if (thisLongString.Values.Count != matchLongString.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisLongString.Values.Count; i++)
                            {
                                if (!WildCardMatchString(matchLongString.Values[i], thisLongString.Values[i], IsCaseSensitiveLO))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.LT:
                    {
                        break;
                    }
                case VR.OB:
                    {
                        break;
                    }
                case VR.OF:
                    {
                        break;
                    }
                case VR.OW:
                    {
                        break;
                    }
                case VR.PN:
                    {
                        PersonName thisPersonName = (PersonName)thisAttribValue;
                        PersonName matchPersonName = (PersonName)matchAttribValue;
                        if (thisPersonName.Values.Count != matchPersonName.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisPersonName.Values.Count; i++)
                            {
                                if (!WildCardMatchString(matchPersonName.Values[i], thisPersonName.Values[i], IsCaseSensitivePN))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.SH:
                    {
                        ShortString thisShortString = (ShortString)thisAttribValue;
                        ShortString matchShortString = (ShortString)matchAttribValue;
                        if (thisShortString.Values.Count != matchShortString.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisShortString.Values.Count; i++)
                            {
                                if (!WildCardMatchString(matchShortString.Values[i], thisShortString.Values[i], IsCaseSensitiveSH))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.SL:
                    {
                        SignedLong thisSignedLong = (SignedLong)thisAttribValue;
                        SignedLong matchSignedLong = (SignedLong)matchAttribValue;
                        if (thisSignedLong.Values.Count != matchSignedLong.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisSignedLong.Values.Count; i++)
                            {
                                if (matchSignedLong.Values[i] != thisSignedLong.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.SQ:
                    {
                        //										SequenceOfItems sequenceOfItems = (SequenceOfItems)attribute.DicomValue;
                        //										foreach (SequenceItem item in sequenceOfItems.Sequence)
                        //										{
                        //										}
                        break;
                    }
                case VR.SS:
                    {
                        SignedShort thisSignedShort = (SignedShort)thisAttribValue;
                        SignedShort matchSignedShort = (SignedShort)matchAttribValue;
                        if (thisSignedShort.Values.Count != matchSignedShort.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisSignedShort.Values.Count; i++)
                            {
                                if (matchSignedShort.Values[i] != thisSignedShort.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.ST:
                    {
                        break;
                    }
                case VR.TM:
                    {
                        isFound = false;

                        Time thisTime = (Time)thisAttribValue;
                        Time matchTime = (Time)matchAttribValue;

                        for (int i = 0; i < thisTime.Values.Count; i++)
                        {
                            if (TMMatching.Matches(thisTime.Values[i], matchTime.Values[0]))
                            {
                                isFound = true;
                                break;
                            }
                        }

                        break;
                    }
                case VR.UI:
                    {
                        UniqueIdentifier thisUniqueIdentifier = (UniqueIdentifier)thisAttribValue;
                        UniqueIdentifier matchUniqueIdentifier = (UniqueIdentifier)matchAttribValue;

                        // check for list of UID matching
                        if ((thisUniqueIdentifier.Values.Count == 1) &&
                            (matchUniqueIdentifier.Values.Count > 1))
                        {
                            isFound = false;

                            // iterate over all the possible matches
                            for (int i = 0; i < matchUniqueIdentifier.Values.Count; i++)
                            {
                                if (MatchString(matchUniqueIdentifier.Values[i], thisUniqueIdentifier.Values[0]))
                                {
                                    isFound = true;
                                    break;
                                }
                            }
                        }
                        else if (thisUniqueIdentifier.Values.Count == matchUniqueIdentifier.Values.Count)
                        {
                            for (int i = 0; i < thisUniqueIdentifier.Values.Count; i++)
                            {
                                if (!MatchString(matchUniqueIdentifier.Values[i], thisUniqueIdentifier.Values[i]))
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            isFound = false;
                        }
                        break;
                    }
                case VR.UL:
                    {
                        UnsignedLong thisUnsignedLong = (UnsignedLong)thisAttribValue;
                        UnsignedLong matchUnsignedLong = (UnsignedLong)matchAttribValue;
                        if (thisUnsignedLong.Values.Count != matchUnsignedLong.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisUnsignedLong.Values.Count; i++)
                            {
                                if (matchUnsignedLong.Values[i] != thisUnsignedLong.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.UN:
                    {
                        break;
                    }
                case VR.US:
                    {
                        UnsignedShort thisUnsignedShort = (UnsignedShort)thisAttribValue;
                        UnsignedShort matchUnsignedShort = (UnsignedShort)matchAttribValue;
                        if (thisUnsignedShort.Values.Count != matchUnsignedShort.Values.Count)
                        {
                            isFound = false;
                        }
                        else
                        {
                            for (int i = 0; i < thisUnsignedShort.Values.Count; i++)
                            {
                                if (matchUnsignedShort.Values[i] != thisUnsignedShort.Values[i])
                                {
                                    isFound = false;
                                    break;
                                }
                            }
                        }
                        break;
                    }
                case VR.UT:
                    {
                        break;
                    }

                default:
                    isFound = false;
                    break;
            }
            return isFound;
        }