Example #1
0
        private ISeries GetSeries(string studyInstanceUid, string seriesInstanceUid)
        {
            if (String.IsNullOrEmpty(studyInstanceUid) || String.IsNullOrEmpty(seriesInstanceUid))
            {
                throw new ArgumentException("The study and series uids must be specified for an image level query.");
            }

            IStudy study = GetStudies(new StudyRootStudyIdentifier {
                StudyInstanceUid = studyInstanceUid
            }).FirstOrDefault();

            if (study == null)
            {
                Platform.Log(LogLevel.Debug, "No study exists with the given study uid ({0}).", studyInstanceUid);
                return(null);
            }

            ISeries series = (from s in study.GetSeries() where s.SeriesInstanceUid == seriesInstanceUid select s).FirstOrDefault();

            if (series == null)
            {
                Platform.Log(LogLevel.Debug, "No series exists with the given study and series uids ({0}, {1})", studyInstanceUid, seriesInstanceUid);
            }

            return(series);
        }
Example #2
0
        private IEnumerable <Series> GetSeries(SeriesEntry criteria)
        {
            try
            {
                string studyInstanceUid = null;
                if (criteria != null && criteria.Series != null)
                {
                    studyInstanceUid = criteria.Series.StudyInstanceUid;
                }

                //This will throw when Uid parameter is empty.
                IStudy study = GetStudy(studyInstanceUid);
                if (study == null)
                {
                    return(new List <Series>());
                }

                //TODO (Marmot): make extended data queryable, too.
                var dicomCriteria = criteria.Series.ToDicomAttributeCollection();
                var filters       = new SeriesPropertyFilters(dicomCriteria);
                var results       = filters.FilterResults(study.GetSeries().Cast <Series>());
                return(results);
            }
            catch (Exception e)
            {
                throw new Exception("An error occurred while performing the series query.", e);
            }
        }
Example #3
0
 private void Initialize()
 {
     foreach (var item in _study.GetSeries())
     {
         SeriesTreeItem seriesitem = new SeriesTreeItem(item, this);
         _tree.Items.Add(seriesitem);
     }
 }
Example #4
0
            private List <DicomAttributeCollection> ImageQuery(QueryCriteria queryCriteria)
            {
                string studyUid  = queryCriteria[DicomTags.StudyInstanceUid];
                string seriesUid = queryCriteria[DicomTags.SeriesInstanceUid];

                if (String.IsNullOrEmpty(studyUid) || String.IsNullOrEmpty(seriesUid))
                {
                    throw new ArgumentException("The study and series uids must be specified for an image level query.");
                }

                IStudy study = GetStudy(studyUid);

                if (study == null)
                {
                    throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));
                }

                ISeries series = CollectionUtils.SelectFirst(study.GetSeries(),
                                                             delegate(ISeries test) { return(test.SeriesInstanceUid == seriesUid); });

                if (series == null)
                {
                    string message = String.Format("No series exists with the given study and series uids ({0}, {1})", studyUid, seriesUid);
                    throw new ArgumentException(message);
                }

                try
                {
                    QueryResultFilter <SopInstance> filter =
                        new QueryResultFilter <SopInstance>(queryCriteria, Convert.Cast <SopInstance>(series.GetSopInstances()), GetSpecificCharacterSet);
                    return(filter.GetResults());
                }
                catch (DataStoreException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new DataStoreException("An error occurred while performing the image query.", e);
                }
            }
Example #5
0
            private List <DicomAttributeCollection> SeriesQuery(QueryCriteria queryCriteria)
            {
                string studyUid = queryCriteria[DicomTags.StudyInstanceUid];

                if (String.IsNullOrEmpty(studyUid))
                {
                    throw new ArgumentException("The study uid must be specified for a series level query.");
                }

                IStudy study = GetStudy(studyUid);

                if (study == null)
                {
                    throw new ArgumentException(String.Format("No study exists with the given study uid ({0}).", studyUid));
                }

                try
                {
                    QueryResultFilter <Series> filter =
                        new QueryResultFilter <Series>(queryCriteria, Convert.Cast <Series>(study.GetSeries()), GetSpecificCharacterSet);
                    return(filter.GetResults());
                }
                catch (DataStoreException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new DataStoreException("An error occurred while performing the series query.", e);
                }
            }