Esempio n. 1
0
        public void SelectBySeriesNumber()
        {
            Study study    = CreateTestStudy1();
            var   criteria = new DicomAttributeCollection();

            criteria[DicomTags.SeriesNumber].SetInt32(0, 2);
            var filters = new SeriesPropertyFilters(criteria);

            var results = filters.FilterResults(study.GetSeries().Cast <Series>());

            Assert.AreEqual(1, results.Count());

            criteria[DicomTags.SeriesNumber].SetInt32(0, 6);
            filters = new SeriesPropertyFilters(criteria);

            results = filters.FilterResults(study.GetSeries().Cast <Series>());
            Assert.AreEqual(0, results.Count());
        }
Esempio n. 2
0
        public void SelectAllSeries()
        {
            Study study    = CreateTestStudy1();
            var   criteria = new DicomAttributeCollection();
            var   filters  = new SeriesPropertyFilters(criteria);
            var   results  = filters.FilterResults(study.GetSeries().Cast <Series>());

            Assert.AreEqual(4, results.Count());
        }
Esempio n. 3
0
        public void SelectByModality_Equals()
        {
            Study study    = CreateTestStudy1();
            var   criteria = new DicomAttributeCollection();

            criteria[DicomTags.Modality].SetString(0, "MR");
            var filters = new SeriesPropertyFilters(criteria);

            var results = filters.FilterResults(study.GetSeries().Cast <Series>());

            Assert.AreEqual(2, results.Count());

            criteria[DicomTags.Modality].SetString(0, "KO");
            filters = new SeriesPropertyFilters(criteria);

            results = filters.FilterResults(study.GetSeries().Cast <Series>());
            Assert.AreEqual(1, results.Count());
        }
Esempio n. 4
0
        public void SelectBySeriesUid_Multiple()
        {
            Study study    = CreateTestStudy1();
            var   criteria = new DicomAttributeCollection();

            criteria[DicomTags.SeriesInstanceUid].SetStringValue("1.2.3.2\\1.2.3.3");
            var filters = new SeriesPropertyFilters(criteria);
            var results = filters.FilterResults(study.GetSeries().Cast <Series>());

            Assert.AreEqual(2, results.Count());
        }
Esempio n. 5
0
        public void SelectAllSops()
        {
            Study study = CreateTestStudy1();
            var   sops  = study.GetSeries().First().GetSopInstances().Cast <SopInstance>().ToList();

            var criteria = new DicomAttributeCollection();
            var filters  = new SopInstancePropertyFilters(criteria);
            var results  = filters.FilterResults(sops);

            Assert.AreEqual(5, results.Count());
        }
Esempio n. 6
0
        public void SelectBySeriesDescription_Wildcard()
        {
            Study study    = CreateTestStudy1();
            var   criteria = new DicomAttributeCollection();

            criteria[DicomTags.SeriesDescription].SetString(0, "*1");
            var filters = new SeriesPropertyFilters(criteria);

            var results = filters.FilterResults(study.GetSeries().Cast <Series>());

            Assert.AreEqual(1, results.Count());
        }
Esempio n. 7
0
        public void AssertUniqueKeys()
        {
            Study study     = CreateTestStudy1();
            var   criteria  = new DicomAttributeCollection();
            var   filters   = new SeriesPropertyFilters(criteria);
            var   results   = filters.FilterResults(study.GetSeries().Cast <Series>()).ToList();
            var   converted = filters.ConvertResultsToDataSets(results);

            foreach (var result in converted)
            {
                //It's 5 because of InstanceAvailability, RetrieveAE, SpecificCharacterSet.
                Assert.AreEqual(5, result.Count);
                Assert.IsNotEmpty(result[DicomTags.StudyInstanceUid]);
                Assert.IsNotEmpty(result[DicomTags.SeriesInstanceUid]);
            }
        }
Esempio n. 8
0
        public void SelectByInstanceNumber()
        {
            Study study = CreateTestStudy1();
            var   sops  = study.GetSeries().First().GetSopInstances().Cast <SopInstance>().ToList();

            var criteria = new DicomAttributeCollection();

            criteria[DicomTags.InstanceNumber].SetInt32(0, 102);

            var filters = new SopInstancePropertyFilters(criteria);
            var results = filters.FilterResults(sops);

            Assert.AreEqual(1, results.Count());

            criteria[DicomTags.InstanceNumber].SetInt32(0, 106);
            filters = new SopInstancePropertyFilters(criteria);

            results = filters.FilterResults(sops);
            Assert.AreEqual(0, results.Count());
        }