示例#1
0
        public void EditorTest()
        {
            Process pacs = new Process();

            pacs.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomEditor\bin\Debug\DicomEditor.exe";

            ApplicationEntity editor  = new ApplicationEntity("DICOMEDITOR", IPAddress.Parse("127.0.0.1"), 2009);
            ApplicationEntity console = new ApplicationEntity("CONSOLE", IPAddress.Parse("127.0.0.1"), 2010);

            try
            {
                pacs.Start();
                StorageTest.Start(console);
            }
            catch
            {
                pacs.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomEditor\bin\Debug\DicomEditor.exe";
                pacs.Start();
            }
            Thread.Sleep(1000);

            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm", editor, true);

            System.Windows.Forms.MessageBox.Show("Click OK to stop Server.");

            StorageTest.Stop();

            pacs.Kill();
        }
示例#2
0
        public void InternalCMoveTest()
        {
            // make sure DICOM at "." is empty
            DicomDir dir = new DicomDir(".");

            dir.Empty();

            ApplicationEntity storage = new ApplicationEntity("ImageServer", IPAddress.Parse("127.0.0.1"), 2000);
            ApplicationEntity server  = new ApplicationEntity("ImageServer", IPAddress.Parse("127.0.0.1"), 5104);

            Dictionary <string, ApplicationEntity> stations = new Dictionary <string, ApplicationEntity>();

            stations.Add(storage.Title, storage);

            StorageTest.Start(storage);
            CMoveTest.Start(server, stations);

            // add three images to a DICOMDIR at "."
            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\Y2ASNFDS.dcm", storage, false);
            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\WNGVU1P1.dcm", storage, false);
            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm", storage, false);

            // ask for an image from a DICOMDIR at "." be delivered to a DICOMDIR at "."
            // should create a duplicate SOPInstanceUID, which results in a WARNING
            try
            {
                move(storage.Title, server);
            }
            catch (Exception)
            {
            }

            CMoveTest.Stop();
            StorageTest.Stop();
        }
示例#3
0
        public void InternalQueryTest2()
        {
            DicomDir dir = new DicomDir(".");

            dir.Empty();

            ApplicationEntity storage = new ApplicationEntity("ImageServer", IPAddress.Parse("127.0.0.1"), 2000);

            StorageTest.Start(storage);

            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\Y2ASNFDS.dcm", storage, false);
            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\WNGVU1P1.dcm", storage, false);
            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm", storage, false);

            StorageTest.Stop();

            ApplicationEntity host = new ApplicationEntity("IMAGESERVER", 2190);

            CFindTest.Start(host);

            CFindServiceSCU find = new CFindServiceSCU(SOPClass.StudyRootQueryRetrieveInformationModelFIND);

            find.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(find);

            if (association.Open(host.Title, host.Address, host.Port))
            {
                Series series = new Series();
                series[t.StudyInstanceUID].Value = "1.2.840.113564.109517115.2009111711190101521";

                DataSet filter = new DataSet();
                filter.Elements = series.Elements;

                filter.Set(t.QueryRetrieveLevel, "SERIES");

                RecordCollection records = find.CFind(filter);
                RecordCollectionTest.WriteRecords(records);
            }
            else
            {
                System.Console.WriteLine("\ncan't Open.");
            }
            association.Close();
            dir.Empty();

            CFindTest.Stop();
        }
示例#4
0
        public void StorageCommitTest()
        {
            ApplicationEntity editor  = new ApplicationEntity("DICOMEDITOR", IPAddress.Parse("127.0.0.1"), 2009);
            ApplicationEntity console = new ApplicationEntity("CONSOLE", IPAddress.Parse("127.0.0.1"), 5040);

            StorageTest.Start(console);

            Thread.Sleep(1000);

            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm", editor, true);

            System.Windows.Forms.MessageBox.Show("Click OK to stop Server.");

            StorageTest.Stop();
        }
示例#5
0
        public void DicomEmptyTest()
        {
            ApplicationEntity host = new ApplicationEntity("DicomEmpty", 2012);

            string store = Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm");

            for (int n = 0; n < 10; n++)
            {
                FilmSession session = CreateFourUpFilmSession();
                print(session, host);

                StorageTest.store(store, host, false);

                string uid = Element.NewUid();
                MppsTest.Begin(uid, host);
                MppsTest.End(uid, host);
            }
        }
示例#6
0
        public void DicomViewerTest()
        {
            Process viewer = new Process();

            viewer.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomViewer\bin\Debug\DicomViewer.exe";

            try
            {
                viewer.Start();
            }
            catch
            {
                viewer.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomViewer\bin\Release\DicomViewer.exe";
                viewer.Start();
            }
            Thread.Sleep(1000);

            ApplicationEntity host = new ApplicationEntity("DICOMVIEWER", 2008);

            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\Y2ASNFDS.dcm", host, false);

            viewer.Kill();
        }
示例#7
0
        public void EditorTest()
        {
            Process pacs = new Process();

            pacs.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomEditor\bin\Debug\DicomEditor.exe";

            ApplicationEntity editor  = new ApplicationEntity("DICOMEDITOR", IPAddress.Parse("127.0.0.1"), 2009);
            ApplicationEntity console = new ApplicationEntity("CONSOLE", IPAddress.Parse("127.0.0.1"), 2010);

            try
            {
                pacs.Start();
                StorageTest.Start(console);
            }
            catch
            {
                pacs.StartInfo.FileName = Tools.RootFolder + @"\EK\Capture\Dicom\Tools\DicomEditor\bin\Debug\DicomEditor.exe";
                pacs.Start();
            }
            Thread.Sleep(1000);

            StorageTest.store(@"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\THGLUZ5J.dcm", editor, false);

            RecordCollection            records;
            Dictionary <string, string> filter;

            filter = new Dictionary <string, string>();
            filter.Add(t.PatientID, "759275");
            records = CFindTest.Query(editor, "STUDY", filter);
            if (records != null)
            {
                filter = new Dictionary <string, string>();
                filter.Add(t.StudyInstanceUID, (string)records[0][t.StudyInstanceUID].Value);
                records = CFindTest.Query(editor, "SERIES", filter);
                if (records != null)
                {
                    filter = new Dictionary <string, string>();
                    filter.Add(t.SeriesInstanceUID, (string)records[0][t.SeriesInstanceUID].Value);
                    records = CFindTest.Query(editor, "IMAGE", filter);
                    if (records != null)
                    {
                        CMoveServiceSCU move = new CMoveServiceSCU(SOPClass.StudyRootQueryRetrieveInformationModelMOVE);
                        move.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);
                        move.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

                        Association association = new Association();
                        association.AddService(move);

                        if (association.Open(editor))
                        {
                            if (move.Active)
                            {
                                move.ImageMoved += new CMoveEventHandler(OnImageMoved);
                                try
                                {
                                    //Element element = new Element(t.SOPInstanceUID, records[0][t.ReferencedSOPInstanceUIDinFile].Value);
                                    Element element = new Element(t.SOPInstanceUID, records[0][t.SOPInstanceUID].Value);
                                    DataSet results = move.CMove(console.Title, element);
                                }
                                catch (Exception ex)
                                {
                                    Debug.WriteLine(ex.Message);
                                    throw;
                                }
                                finally
                                {
                                    move.ImageMoved -= new CMoveEventHandler(OnImageMoved);
                                }
                            }
                        }
                        else
                        {
                            Debug.WriteLine("\ncan't Open.");
                        }

                        association.Close();
                    }
                }
            }
            pacs.Kill();
        }