public ImageSopInstanceReferenceDictionary(IEnumerable <ImageSopInstanceReferenceMacro> imageSopReferences, bool emptyDictionaryMatchesAll)
        {
            Platform.CheckForNullReference(imageSopReferences, "imageSopReferences");

            _emptyDictionaryMatchesAll = emptyDictionaryMatchesAll;

            foreach (ImageSopInstanceReferenceMacro imageSopReference in imageSopReferences)
            {
                DicomAttributeIS frames    = imageSopReference.ReferencedFrameNumber;
                List <int>       frameList = null;
                if (!frames.IsNull && !frames.IsEmpty && frames.Count > 0)
                {
                    frameList = new List <int>();
                    for (int n = 0; n < frames.Count; n++)
                    {
                        frameList.Add(frames.GetInt32(n, -1));
                    }
                }
                _frameDictionary.Add(imageSopReference.ReferencedSopInstanceUid, frameList);

                DicomAttributeUS segments    = imageSopReference.ReferencedSegmentNumber;
                List <uint>      segmentList = null;
                if (!segments.IsNull && !segments.IsEmpty && segments.Count > 0)
                {
                    segmentList = new List <uint>();
                    for (int n = 0; n < segments.Count; n++)
                    {
                        segmentList.Add(segments.GetUInt32(n, 0));
                    }
                }
                _segmentDictionary.Add(imageSopReference.ReferencedSopInstanceUid, segmentList);
            }
        }
示例#2
0
            public void TestConstructors()
            {
                try
                {
                    DicomAttributeIS attrib = new DicomAttributeIS(DicomTagDictionary.GetDicomTag(DicomTags.AccessionNumber));
                    Assert.Fail("Above statement should throw exception");
                }
                catch (DicomException)
                {

                }

            }
示例#3
0
 public DicomAttributeIS CreateAttribute()
 {
     DicomAttributeIS attrib = new DicomAttributeIS(DicomTagDictionary.GetDicomTag(DicomTags.WedgeNumber));
     Assert.AreEqual(0, attrib.Count);
     Assert.AreEqual(0, attrib.StreamLength);
     return attrib;
 }