Ejemplo n.º 1
0
        private static Dictionary<ProbeFileKey, Dictionary<USImageKey, USImageInfo>> GetProbes(List<ProbeUSImage> _rows)
        {
            var probes = new Dictionary<ProbeFileKey, Dictionary<USImageKey, USImageInfo>>();

            foreach (var row in _rows)
            {
                var fileKey = new ProbeFileKey
                {
                    Probe = row.Probe,
                    Direction = row.Direction,
                };

                Dictionary<USImageKey, USImageInfo> images;
                if (probes.ContainsKey(fileKey))
                {
                    images = probes[fileKey];
                }
                else
                {
                    images = new Dictionary<USImageKey, USImageInfo>();
                    probes.Add(fileKey, images);
                }

                var key = new USImageKey
                {
                    Depth = row.Depth,
                    Direction = row.Direction,
                };

                USImageInfo info;
                if (images.ContainsKey(key))
                {
                    info = images[key];
                }
                else
                {
                    info = new USImageInfo
                    {
                        PixelSpacing = row.PixelSpacing,
                        ImageShift = row.ImageShift,
                        Guides = new Dictionary<Guide, Dictionary<LeftRight, NeedleGuideValues2>>(),
                    };
                    images.Add(key, info);
                }

                Dictionary<LeftRight, NeedleGuideValues2> guides;
                if (info.Guides.ContainsKey(row.NeedleGuideName))
                {
                    guides = info.Guides[row.NeedleGuideName];
                }
                else
                {
                    guides = new Dictionary<LeftRight, NeedleGuideValues2>();
                    info.Guides.Add(row.NeedleGuideName, guides);
                }

                if (!guides.ContainsKey(row.LeftRight))
                {
                    guides.Add(row.LeftRight, row.NeedleGuideValues);
                }
            }

            return probes;
        }
Ejemplo n.º 2
0
        public bool Equals(USImageKey _spacing)
        {
            var equals = false;

            if (_spacing != null)
            {
                equals = true;
                equals &= this.Depth == _spacing.Depth;
                equals &= this.Direction == _spacing.Direction;
            }

            return equals;
        }