예제 #1
0
        public void TestUnsupportedMultiModalityQuery2()
        {
            var server = new TestDicomServiceNode();

            server.Studies.AddRange(CreateTestStudies());
            server.StudyMatcher = null;
            foreach (var study in server.Studies)
            {
                study.ModalitiesInStudy = new string[0];                                               // blank the modalities field
            }
            var expectedStudies = server.Studies.Select(s => s.StudyInstanceUid).ToList();

            var actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "PT", "CT", "ZZ" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();

            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['PT','CT','ZZ']");
            Assert.AreEqual(1, server.QueryCount, "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "PT", "ZZ", "CT", "KO", "PR" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['PT','ZZ','CT','KO','PR']");
            Assert.AreEqual(2, server.QueryCount, "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "ZZ", "PT", "CT", "KO", "PR" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['ZZ','PT','CT','KO','PR']");
            Assert.AreEqual(3, server.QueryCount, "Too many server query calls");
        }
예제 #2
0
        public void TestUnindexedOpenModalityQuery()
        {
            var server = new TestDicomServiceNode();

            server.Studies.AddRange(CreateTestStudies());
            server.StudyMatcher = null;

            var expectedStudies = server.Studies.Select(s => s.StudyInstanceUid).ToList();

            var actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = null
            }).Select(s => s.Study.StudyInstanceUid).ToList();

            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=null");
            Assert.AreEqual(1, server.QueryCount, "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new string[0]
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=[]");
            Assert.AreEqual(2, server.QueryCount, "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['']");
            Assert.AreEqual(3, server.QueryCount, "Too many server query calls");
        }
예제 #3
0
        public void TestIdealMultiModalityQuery()
        {
            var server = new TestDicomServiceNode();

            server.Studies.AddRange(CreateTestStudies());
            server.StudyMatcher = IdealMatchModalitiesInStudy;

            var expectedStudies = new[]
            {
                "11", "12", "13", "14", "15",
                "21", "22", "23", "24", "25",
                "51", "52", "53", "54", "55"
            };

            var actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "PT", "CT" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();

            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['PT','CT']");
            Assert.AreEqual(2, server.ResetQueryCount(), "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "CT", "PT" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['CT','PT']");
            Assert.AreEqual(2, server.ResetQueryCount(), "Too many server query calls");

            expectedStudies = new[]
            {
                "04", "05", "06", "07",
                "11", "12", "13", "14", "15",
                "21", "22", "23", "24", "25",
                "34", "35",
                "44", "45",
                "51", "52", "53", "54", "55"
            };

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "PT", "CT", "KO", "PR" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['PT','CT','KO','PR']");
            Assert.AreEqual(4, server.ResetQueryCount(), "Too many server query calls");
        }
예제 #4
0
        public StudyBrowserControl(StudyBrowserComponent component)
        {
            Platform.CheckForNullReference(component, "component");
            InitializeComponent();

            _studyBrowserComponent = component;
            _studyBrowserComponent.StudyTableChanged    += OnStudyBrowserComponentOnStudyTableChanged;
            _studyBrowserComponent.SelectedStudyChanged += OnStudyBrowserComponentSelectedStudyChanged;
            _studyTableView.Table              = _studyBrowserComponent.StudyTable;
            _studyTableView.ToolbarModel       = _studyBrowserComponent.ToolbarModel;
            _studyTableView.MenuModel          = _studyBrowserComponent.ContextMenuModel;
            _studyTableView.SelectionChanged  += new EventHandler(OnStudyTableViewSelectionChanged);
            _studyTableView.ItemDoubleClicked += new EventHandler(OnStudyTableViewDoubleClick);

            _bindingSource            = new BindingSource();
            _bindingSource.DataSource = _studyBrowserComponent;

            _resultsTitleBar.DataBindings.Add("Text", _studyBrowserComponent, "ResultsTitle", true, DataSourceUpdateMode.OnPropertyChanged);

            this.DataBindings.Add("Enabled", _studyBrowserComponent, "IsEnabled");
        }
예제 #5
0
		public StudyBrowserControl(StudyBrowserComponent component)
		{
			Platform.CheckForNullReference(component, "component");
			InitializeComponent();

			_studyBrowserComponent = component;
			_studyBrowserComponent.StudyTableChanged += OnStudyBrowserComponentOnStudyTableChanged;
			_studyBrowserComponent.SelectedStudyChanged += OnStudyBrowserComponentSelectedStudyChanged;
			_studyTableView.Table = _studyBrowserComponent.StudyTable;
			_studyTableView.ToolbarModel = _studyBrowserComponent.ToolbarModel;
			_studyTableView.MenuModel = _studyBrowserComponent.ContextMenuModel;
			_studyTableView.SelectionChanged += new EventHandler(OnStudyTableViewSelectionChanged);
			_studyTableView.ItemDoubleClicked += new EventHandler(OnStudyTableViewDoubleClick);

			_bindingSource = new BindingSource();
			_bindingSource.DataSource = _studyBrowserComponent;

			_resultsTitleBar.DataBindings.Add("Text", _studyBrowserComponent, "ResultsTitle", true, DataSourceUpdateMode.OnPropertyChanged);

			this.DataBindings.Add("Enabled", _studyBrowserComponent, "IsEnabled");
		}
예제 #6
0
        public void TestIdealSingleModalityQuery2()
        {
            var server = new TestDicomServiceNode();

            server.Studies.AddRange(CreateTestStudies());
            server.StudyMatcher = IdealMatchModalitiesInStudy;

            var expectedStudies = new string[0];

            var actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "ZZ" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();

            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['ZZ']");
            Assert.AreEqual(1, server.ResetQueryCount(), "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "ZZ", "ZZ" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['ZZ','ZZ']");
            Assert.AreEqual(1, server.ResetQueryCount(), "Too many server query calls");
        }
예제 #7
0
        public void TestIdealSingleModalityQuery()
        {
            var server = new TestDicomServiceNode();

            server.Studies.AddRange(CreateTestStudies());
            server.StudyMatcher = IdealMatchModalitiesInStudy;

            var expectedStudies = new[] { "01", "02", "03", "04", "05", "06", "07" };

            var actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "MR" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();

            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['MR']");
            Assert.AreEqual(1, server.QueryCount, "Too many server query calls");

            actualStudies = StudyBrowserComponent.TestGetStudyEntries(server, new StudyRootStudyIdentifier {
                ModalitiesInStudy = new[] { "MR", "MR" }
            }).Select(s => s.Study.StudyInstanceUid).ToList();
            AssertCollections(expectedStudies, actualStudies, "ModalitiesInStudy=['MR','MR']");
            Assert.AreEqual(2, server.QueryCount, "Too many server query calls");
        }
 public void SetComponent(IApplicationComponent component)
 {
     _component = component as StudyBrowserComponent;
 }
예제 #9
0
		public FilterDuplicateStudiesTool(StudyBrowserComponent parent)
		{
			_parent = parent;
		}
예제 #10
0
		public void SetComponent(IApplicationComponent component)
		{
			_component = component as StudyBrowserComponent;
		}