Exemplo n.º 1
0
		IImageSet IImageSetFactory.CreateImageSet(Study study)
		{
			Platform.CheckForNullReference(study, "study");
			Platform.CheckMemberIsSet(_studyTree, "_studyTree");

			return CreateImageSet(study);
		}
Exemplo n.º 2
0
		protected virtual IImageSet CreateImageSet(Study study)
		{
			ImageSet imageSet = null;
			List<IDisplaySet> displaySets = CreateDisplaySets(study);

			if (displaySets.Count > 0)
			{
				imageSet = new ImageSet(CreateImageSetDescriptor(study));
				
				foreach (IDisplaySet displaySet in displaySets)
					imageSet.DisplaySets.Add(displaySet);
			}

			return imageSet;
		}
Exemplo n.º 3
0
            public void AddMultiSeriesDisplaySets(IImageSet imageSet, Study study)
            {
                var multiSeriesModalities = (from option in _displaySetCreationOptions
                                       where option.CreateAllImagesDisplaySet
                                       join series in study.Series
                                           on option.Modality equals series.Modality
                                       select option.Modality).Distinct();

                foreach (var modality in multiSeriesModalities)
                {
                    //Add all the "all images" per modality display sets for the entire study at the top of the list.
                    var displaySet = _modalityDisplaySetFactory.CreateDisplaySet(study, modality);
                    if (displaySet != null)
                        imageSet.DisplaySets.Add(displaySet);
                }
            }
Exemplo n.º 4
0
        private void AddSeries(Sop sop)
        {
            Series series;

            if (_series.ContainsKey(sop.SeriesInstanceUid))
            {
                series = _series[sop.SeriesInstanceUid];
            }
            else
            {
                Study study = _studies[sop.StudyInstanceUid];
                series = new Series(study);
                series.SetSop(sop);
                study.Series.Add(series);

                _series[series.SeriesInstanceUid] = series;
            }

            sop.ParentSeries = series;
            series.Sops.Add(sop);
        }
Exemplo n.º 5
0
        public override List<IDisplaySet> CreateDisplaySets(Study study)
        {
            var displaySets = new List<IDisplaySet>();
            foreach (var seriesByModality in study.Series.GroupBy(s => s.Modality))
            {
                var displaySet = CreateDisplaySet(study, seriesByModality);
                if (displaySet != null)
                {
                    displaySet.PresentationImages.Sort();
                    displaySets.Add(displaySet);
                }
            }

            return displaySets;
        }
Exemplo n.º 6
0
 public IDisplaySet CreateDisplaySet(Study study, string modality)
 {
     return CreateDisplaySet(study, study.Series.Where(s => s.Modality == modality));
 }
Exemplo n.º 7
0
        private IDisplaySet CreateDisplaySet(Study study, IEnumerable<Series> modalitySeries)
        {
            var first = modalitySeries.FirstOrDefault();
            if (first == null)
                return null; 

            var modality = first.Modality;
            if (String.IsNullOrEmpty(modality))
                return null;

            var displaySet = new DisplaySet(new ModalityDisplaySetDescriptor(study.GetIdentifier(), modality, PresentationImageFactory));
            int seriesCount = 0;
            foreach (var series in modalitySeries)
            {
                bool added = false;
                foreach (var imageSop in series.Sops) //We don't want key images, references etc.
                {
                    foreach (var image in PresentationImageFactory.CreateImages(imageSop))
                    {
                        displaySet.PresentationImages.Add(image);
                        added = true;
                    }
                }

                if (added)
                    ++seriesCount;
            }

            // Degenerate case is one series, in which case we don't create this display set.
            if (seriesCount > 1)
                return displaySet;

            displaySet.Dispose();
            return null;
        }
Exemplo n.º 8
0
        protected virtual DicomImageSetDescriptor CreateImageSetDescriptor(Study study)
		{
			return new DicomImageSetDescriptor(study.GetIdentifier());
		}
Exemplo n.º 9
0
		protected virtual List<IDisplaySet> CreateDisplaySets(Study study)
		{
		    return _displaySetFactory.CreateDisplaySets(study);
		}
Exemplo n.º 10
0
		internal Series(Study parentStudy)
		{
			_parentStudy = parentStudy;
		}
Exemplo n.º 11
0
 internal Series(Study parentStudy)
 {
     _parentStudy = parentStudy;
 }
Exemplo n.º 12
0
		private void AddStudy(Sop sop)
		{
			if (_studies.ContainsKey(sop.StudyInstanceUid))
				return;

			Patient patient = _patients[sop.PatientId];
			Study study = new Study(patient);
			study.SetSop(sop);
			patient.Studies.Add(study);

			_studies[study.StudyInstanceUid] = study;
		}
Exemplo n.º 13
0
 /// <summary>
 /// Creates zero or more <see cref="IDisplaySet"/>s from the given <see cref="Study"/>.
 /// </summary>
 /// <returns>Zero or more <see cref="IDisplaySet"/>s.</returns>
 public virtual List<IDisplaySet> CreateDisplaySets(Study study)
 {
     var displaySets = new List<IDisplaySet>();
     foreach (var series in study.Series)
        displaySets.AddRange(CreateDisplaySets(series));
     return displaySets;
 }
Exemplo n.º 14
0
		internal StudyLoadedEventArgs(Study study, Exception error)
		{
			this.Error = error;
			this.Study = study;
		}