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