Beispiel #1
0
        protected void InitializeAnnotationList(string studyInstanceUID)
        {
            if (_annotationDictionary.ContainsStudy(studyInstanceUID))
            {
                return;
            }

            StudyItemList studyAnnotations = GetAnnotationsList(studyInstanceUID);             // TODO - switch to using SR IOD when we have it

            if (studyAnnotations == null || studyAnnotations.Count == 0)
            {
                return;
            }

            using (IDataStoreReader reader = DataAccessLayer.GetIDataStoreReader())
            {
                foreach (StudyItem studyItem in studyAnnotations)
                {
                    ClearCanvas.Dicom.DataStore.Study study = reader.GetStudy(studyItem.StudyInstanceUid) as ClearCanvas.Dicom.DataStore.Study;
                    if (study != null)
                    {
                        IEnumerable <ISeries> allSeries = study.GetSeries();
                        foreach (ISeries series in allSeries)
                        {
                            if (series != null && series.Modality == "SR")
                            {
                                IEnumerable <ISopInstance> sopInstances = series.GetSopInstances();
                                foreach (ISopInstance sopInstance in sopInstances)
                                {
                                    if (sopInstance != null)
                                    {
                                        DicomUri fileUri = sopInstance.GetLocationUri();
                                        if (fileUri.IsFile)
                                        {
                                            _annotationDictionary.Add(study.StudyInstanceUid, series.SeriesInstanceUid, sopInstance.SopInstanceUid, fileUri.LocalDiskPath);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                // TODO:
                // 1. Find and load all annotations (read-only?)
                //      LocalDataStoreActivityMonitor.Instance.
            }
        }
            private Study GetStudy(string studyInstanceUid)
            {
                if (_existingStudyCache.ContainsKey(studyInstanceUid))
                {
                    return(_existingStudyCache[studyInstanceUid]);
                }

                //everything gets added for xml update
                if (_studiesToUpdateInXml.ContainsKey(studyInstanceUid))
                {
                    return(_studiesToUpdateInXml[studyInstanceUid]);
                }

                Study existingStudy = (Study)GetIDataStoreReader().GetStudy(studyInstanceUid);

                if (existingStudy != null)
                {
                    _existingStudyCache[existingStudy.StudyInstanceUid] = existingStudy;
                }

                return(existingStudy);
            }
Beispiel #3
0
 internal Series(Study parentStudy, SeriesXml seriesXml)
 {
     _parentStudy = parentStudy;
     _seriesXml   = seriesXml;
 }
Beispiel #4
0
 private static string GetSpecificCharacterSet(Study study)
 {
     return(study.SpecificCharacterSet);
 }