示例#1
0
        private static IXRay3DAcquisitionSequenceItem[] GetAcquisitions(Frame frame, int[] acquisitionIndices)
        {
            var acquisitionModule = new XRay3DAcquisitionModule(frame.ParentImageSop);

            if (!acquisitionModule.HasValues())
            {
                return(null);
            }

            var acquisitionItems = acquisitionModule.XRay3DAcquisitionSequence;

            if (acquisitionItems == null)
            {
                return(null);
            }

            // if acquisition indices are not specified, but the acquisition sequence exists and has exactly one item, assume everything came from that acquisition
            if (acquisitionIndices == null)
            {
                return acquisitionItems.Length == 1 ? new[] { acquisitionItems[0] }
            }
            : null;

            // DICOM indexes are 1-based
            return(acquisitionIndices.Min() > 0 && acquisitionItems.Length >= acquisitionIndices.Max()
                                ? acquisitionIndices.Select(i => acquisitionItems[i - 1]).ToArray() : null);
        }
        private static IXRay3DAcquisitionSequenceItem[] GetAcquisitions(Frame frame, int[] acquisitionIndices)
        {
            var acquisitionModule = new XRay3DAcquisitionModule(frame.ParentImageSop);

            if (!acquisitionModule.HasValues())
            {
                return(null);
            }

            var acquisitionItems = acquisitionModule.XRay3DAcquisitionSequence;

            if (acquisitionItems == null)
            {
                return(null);
            }

            // DICOM indexes are 1-based
            return(acquisitionIndices != null && acquisitionIndices.Min() > 0 &&
                   acquisitionItems.Length >= acquisitionIndices.Max() ? acquisitionIndices.Select(i => acquisitionItems[i - 1]).ToArray() : null);
        }