Exemplo n.º 1
0
        void mwl(string title, IPAddress address, int port, Dictionary <string, string> filter)
        {
            CFindServiceSCU mwl = new CFindServiceSCU(SOPClass.ModalityWorklistInformationModelFIND);

            mwl.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);
            mwl.Syntaxes.Add(Syntax.ExplicitVrBigEndian);
            mwl.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(mwl);

            if (association.Open(title, address, port))
            {
                DataSet query = GetQuery(filter);

                RecordCollection records = mwl.CFind(query);
                RecordCollectionTest.WriteRecords(records);
            }
            else
            {
                System.Console.WriteLine("\ncan't Open.");
            }
            association.Close();
        }
Exemplo n.º 2
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();
        }