Exemple #1
0
        private static List <IDisplaySet> CreateDisplaySets(IDisplaySetFactory displaySetFactory, IEnumerable <ISopDataSource> sopDataSources, out StudyTree studyTree)
        {
            studyTree = new StudyTree();
            foreach (var sopDataSource in sopDataSources)
            {
                studyTree.AddSop(new ImageSop(sopDataSource));
            }
            displaySetFactory.SetStudyTree(studyTree);

            var displaySets = new List <IDisplaySet>();

            foreach (var patient in studyTree.Patients)
            {
                foreach (var study in patient.Studies)
                {
                    displaySets.AddRange(displaySetFactory.CreateDisplaySets(study));
                }
            }
            return(displaySets);
        }
 protected virtual List <IDisplaySet> CreateDisplaySets(Study study)
 {
     return(_displaySetFactory.CreateDisplaySets(study));
 }
Exemple #3
0
            public override List <IDisplaySet> CreateDisplaySets(Series series)
            {
                var displaySets = new List <IDisplaySet>();

                bool showOriginal = true;

                if (SplitMultiEchoSeries)
                {
                    List <IDisplaySet> echoDisplaySets = _echoFactory.CreateDisplaySets(series);
                    if (echoDisplaySets.Count > 0 && !ShowOriginalMREchoSeries)
                    {
                        showOriginal = false;
                    }

                    displaySets.AddRange(echoDisplaySets);
                }

                if (SplitMixedMultiframeSeries)
                {
                    List <IDisplaySet> multiFrameDisplaySets = _mixedMultiFrameFactory.CreateDisplaySets(series);
                    if (multiFrameDisplaySets.Count > 0 && !ShowOriginalMixedMultiframeSeries)
                    {
                        showOriginal = false;
                    }

                    displaySets.AddRange(multiFrameDisplaySets);
                }

                bool modalityDegenerateCase    = CreateAllImagesDisplaySet && !ModalityDisplaySetExists;
                bool singleImageDegenerateCase = false;

                if (CreateSingleImageDisplaySets)
                {
                    //The factory will only create single image display sets and will not create a series
                    //display set for the degenerate case of one image in a series. In the case where
                    //the user wants to see "single image" display sets, we actually create a series
                    //display set (below) for the degenerate case, because that's technically more correct.
                    _basicFactory.CreateSingleImageDisplaySets = true;
                    var singleImageDisplaySets = new List <IDisplaySet>();
                    foreach (IDisplaySet displaySet in _basicFactory.CreateDisplaySets(series))
                    {
                        singleImageDisplaySets.Add(displaySet);
                    }

                    displaySets.AddRange(singleImageDisplaySets);

                    singleImageDegenerateCase = singleImageDisplaySets.Count == 0;
                }

                //Show the original if:
                // 1. A previous part of this method hasn't already disabled it.
                // 2. The user wants to see it, or
                // 3. It's a degenerate case
                showOriginal = showOriginal && (ShowOriginalSeries || modalityDegenerateCase || singleImageDegenerateCase);
                if (showOriginal)
                {
                    //The factory will create series display sets only.
                    _basicFactory.CreateSingleImageDisplaySets = false;
                    foreach (IDisplaySet displaySet in _basicFactory.CreateDisplaySets(series))
                    {
                        displaySets.Add(displaySet);
                    }
                }

                bool anyDisplaySetsCreated = displaySets.Count > 0 || ModalityDisplaySetExists;

                if (!anyDisplaySetsCreated)
                {
                    displaySets.AddRange(_placeholderDisplaySetFactory.CreateDisplaySets(series));
                }

                foreach (var factory in _externalFactories)
                {
                    displaySets.AddRange(factory.CreateDisplaySets(series));
                }

                foreach (var displaySet in displaySets)
                {
                }
                return(displaySets);
            }