示例#1
0
        public void InternalQueryTest()
        {
            string title = "QUERY";
            int    port  = 2104;

            Server server = new Server(title, port);

            CFindServiceSCP ris = new CFindServiceSCP(SOPClass.ModalityWorklistInformationModelFIND);

            ris.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            ris.Query += new QueryEventHandler(OnQuery);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(ris);
            server.AddService(echo);

            server.Start();

            Dictionary <string, string> filter = new Dictionary <string, string>();

            filter.Add(t.PatientName, "*");
            filter.Add(t.ScheduledProcedureStepSequence + t.Modality, "CR");
            filter.Add(t.ScheduledProcedureStepSequence + t.ScheduledProcedureStepStartDate, DateTime.Now.ToString("yyyyMMdd"));

            mwl(title, IPAddress.Parse("127.0.0.1"), port, filter);

            server.Stop();
        }
示例#2
0
        public static void Start(ApplicationEntity host)
        {
            if (server != null)
            {
                throw new Exception("CFindTest.Server in use.");
            }

            server = new Server(host.Title, host.Port);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CFindServiceSCP study = new CFindServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelFIND);

            study.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            study.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CFindServiceSCP patient = new CFindServiceSCP(SOPClass.PatientRootQueryRetrieveInformationModelFIND);

            patient.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            patient.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(study);
            server.AddService(patient);

            server.Start();
        }
示例#3
0
        static void printservice(bool wait)
        {
            Server server = new Server("PRINTER", 5000);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PrintServiceSCP grayscale = new PrintServiceSCP(PrintClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(grayscale);

            server.Start();

            if (wait)
            {
                System.Console.WriteLine("\nPress <enter> to stop server ...");
                System.Console.ReadLine();
            }
            else
            {
                print("PRINTER", IPAddress.Parse("127.0.0.1"), 5000);
            }

            server.Stop();
        }
示例#4
0
        public void ServerTest()
        {
            string title = "Worklist_SCP";
            int    port  = 6104;

            Server server = new Server(title, port);

            CFindServiceSCP ris = new CFindServiceSCP(SOPClass.ModalityWorklistInformationModelFIND);

            ris.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            ris.Query += new QueryEventHandler(OnQuery);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(ris);
            server.AddService(echo);

            server.Start();

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

            server.Stop();
        }
示例#5
0
        private static Server StartServer(string title, int port, PrintJobEventHandler handler)
        {
            Server server = new Server(title, port);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PrintServiceSCP grayscale = new PrintServiceSCP(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            if (handler != null)
            {
                grayscale.JobPrinted += handler;
            }

            PresentationLUTServiceSCP plut = new PresentationLUTServiceSCP();

            plut.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            AnnotationServiceSCP annotation = new AnnotationServiceSCP();

            annotation.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(grayscale);
            server.AddService(plut);
            server.AddService(annotation);

            server.Start();

            return(server);
        }
示例#6
0
        private void StartServer()
        {
            server = new Server(aetitle, port);

            VerificationServiceSCP service = new VerificationServiceSCP();

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

            server.AddService(service);

            server.Start();
        }
示例#7
0
        public void InternalEchoTest()
        {
            // start an SCP
            Server server = new Server("ECHO", 1234);

            VerificationServiceSCP service = new VerificationServiceSCP();

            service.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(service);

            server.Start();

            // create an SCU and echo
            echo("ECHO", IPAddress.Parse("127.0.0.1"), 1234);

            server.Stop();
        }
示例#8
0
        public static void Start(ApplicationEntity host, Dictionary <string, ApplicationEntity> stations)
        {
            if (server != null)
            {
                throw new Exception("CMoveTest.Server in use.");
            }

            server = new Server(host.Title, host.Port);

            server.Hosts = stations;

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CMoveServiceSCP pm = new CMoveServiceSCP(SOPClass.PatientRootQueryRetrieveInformationModelMOVE);

            pm.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            pm.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CMoveServiceSCP pf = new CMoveServiceSCP(SOPClass.PatientRootQueryRetrieveInformationModelFIND);

            pf.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            pf.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CMoveServiceSCP sm = new CMoveServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelMOVE);

            sm.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            sm.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            CMoveServiceSCP sf = new CMoveServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelFIND);

            sf.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            sf.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(pm);
            server.AddService(pf);
            server.AddService(sm);
            server.AddService(sf);

            server.Start();
        }
示例#9
0
        static void storeservice(bool wait)
        {
            Server server = new Server("HARVEST", 2000);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP dx = new StorageServiceSCP(StorageClass.DigitalXRayImageStorageForPresentation);

            dx.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP cr = new StorageServiceSCP(StorageClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            ImageStorageEventHandler handler = new ImageStorageEventHandler(OnImageStored);

            dx.ImageStored += handler;
            cr.ImageStored += handler;

            server.AddService(echo);
            server.AddService(dx);
            server.AddService(cr);

            server.Start();

            if (wait)
            {
                System.Console.WriteLine("\nPress <enter> to stop server ...");
                System.Console.ReadLine();
            }
            else
            {
                store("HARVEST", IPAddress.Parse("127.0.0.1"), 2000);
            }

            dx.ImageStored -= handler;
            cr.ImageStored -= handler;

            //System.Console.WriteLine("before Stop!");
            server.Stop();
            //System.Console.WriteLine("after Stop!");
        }
示例#10
0
        private void StartServer()
        {
            server = new Server(aetitle, port);

            var ris = new CFindServiceSCP(SOPClass.ModalityWorklistInformationModelFIND);

            ris.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            ris.Query += new QueryEventHandler(OnQuery);

            var echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(ris);
            server.AddService(echo);

            server.Start();
        }
示例#11
0
        static void mppsservice(bool wait)
        {
            Server server = new Server("MPPS", 2010);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            MppsServiceSCP mpps = new MppsServiceSCP();

            mpps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            MppsEventHandler handler = new MppsEventHandler(OnMpps);

            mpps.MppsCreate += handler;
            mpps.MppsSet    += handler;

            server.AddService(echo);
            server.AddService(mpps);

            server.Start();

            if (wait)
            {
                System.Console.WriteLine("\nPress <enter> to stop server ...");
                System.Console.ReadLine();
            }
            else
            {
                string            uid  = Element.NewUid();
                ApplicationEntity host = new ApplicationEntity("MPPS", IPAddress.Parse("10.95.53.106"), 2010);
                Begin(uid, host);
                End(uid, host);
            }

            mpps.MppsCreate -= handler;
            mpps.MppsSet    -= handler;

            server.Stop();
        }
示例#12
0
        private void Start()
        {
            if (server == null)
            {
                server = new Server(new ApplicationEntity("DicomWorklist", 6104));

                VerificationServiceSCP echo = new VerificationServiceSCP();
                echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
                echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);
                echo.Syntaxes.Add(Syntax.ExplicitVrBigEndian);

                CFindServiceSCP ris = new CFindServiceSCP(SOPClass.ModalityWorklistInformationModelSOPClass);
                ris.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
                ris.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);
                ris.Syntaxes.Add(Syntax.ExplicitVrBigEndian);
                ris.Query += new QueryEventHandler(OnQuery);

                server.AddService(echo);
                server.AddService(ris);

                server.Start();
            }
        }
示例#13
0
        static void echoservice(bool wait)
        {
            Server server = new Server("ECHO", 1234);

            VerificationServiceSCP service = new VerificationServiceSCP();

            service.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(service);

            server.Start();

            if (wait)
            {
                System.Console.WriteLine("\nPress <enter> to stop server ...");
                System.Console.ReadLine();
            }
            else
            {
                echo("ECHO", IPAddress.Parse("127.0.0.1"), 1234);
            }

            server.Stop();
        }
示例#14
0
        private void StartServer()
        {
            if (TestServer())
            {
                SetStatus("SCP is already running in another instance.");
                return;
            }

            server = new Server(aetitle, port);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP dx1 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            dx1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP dx2 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForProcessing);

            dx2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP cr = new StorageServiceSCP(SOPClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP mg1 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForPresentation);

            mg1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP mg2 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForProcessing);

            mg2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP gsps = new StorageServiceSCP(SOPClass.GrayscaleSoftcopyPresentationStateStorageSOPClass);

            gsps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP sc = new StorageServiceSCP(SOPClass.SecondaryCaptureImageStorage);

            sc.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP ct = new StorageServiceSCP(SOPClass.CTImageStorage);

            ct.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP ctEnhanced = new StorageServiceSCP(SOPClass.EnhancedCTImageStorage);

            ctEnhanced.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP dose = new StorageServiceSCP(SOPClass.XRayRadiationDoseSRStorage);

            dose.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            CFindServiceSCP find = new CFindServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelFIND);

            find.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            CMoveServiceSCP move = new CMoveServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelMOVE);

            move.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            MppsServiceSCP mpps = new MppsServiceSCP();

            mpps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageCommitServiceSCP commit = new StorageCommitServiceSCP();

            commit.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PrintServiceSCP grayscale = new PrintServiceSCP(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PresentationLUTServiceSCP plut = new PresentationLUTServiceSCP();

            plut.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            AnnotationServiceSCP annotation = new AnnotationServiceSCP();

            annotation.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(dx1);
            server.AddService(dx2);
            server.AddService(cr);
            server.AddService(mg1);
            server.AddService(mg2);
            server.AddService(gsps);
            server.AddService(sc);
            server.AddService(ct);
            server.AddService(ctEnhanced);
            server.AddService(dose);
            server.AddService(find);
            server.AddService(move);
            server.AddService(mpps);
            server.AddService(commit);
            server.AddService(grayscale);
            server.AddService(plut);
            server.AddService(annotation);

            ImageStoredEventHandler   imageHandler  = new ImageStoredEventHandler(OnImageStored);
            MppsEventHandler          mppsHandler   = new MppsEventHandler(OnMpps);
            StorageCommitEventHandler commitHandler = new StorageCommitEventHandler(OnStorageCommitRequest);

            foreach (ServiceClass service in server.Services)
            {
                if (service != null)
                {
                    if (service is StorageServiceSCP)
                    {
                        ((StorageServiceSCP)service).ImageStored += imageHandler;
                    }
                    else if (service is PrintServiceSCP)
                    {
                        ((PrintServiceSCP)service).JobPrinted += new PrintJobEventHandler(OnJobPrinted);
                    }
                    else if (service is MppsServiceSCP)
                    {
                        ((MppsServiceSCP)service).MppsCreate += mppsHandler;
                        ((MppsServiceSCP)service).MppsSet    += mppsHandler;
                    }
                    else if (service is StorageCommitServiceSCP)
                    {
                        ((StorageCommitServiceSCP)service).StorageCommitRequest += new StorageCommitEventHandler(OnStorageCommitRequest);
                    }
                    else if (service is CFindServiceSCP)
                    {
                        ((CFindServiceSCP)service).Query += new QueryEventHandler(OnQuery);
                    }
                }
            }

            server.Start();
        }
示例#15
0
        private void StartServer()
        {
            if (TestServer())
            {
                SetStatus("SCP is already running in another instance.");
                return;
            }

            server = new Server(AeTitle, Port);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);


            StorageServiceSCP dx1 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            dx1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP dx2 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForProcessing);

            dx2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP cr = new StorageServiceSCP(SOPClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP mg1 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForPresentation);

            mg1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP mg2 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForProcessing);

            mg2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP gsps = new StorageServiceSCP(SOPClass.GrayscaleSoftcopyPresentationStateStorageSOPClass);

            gsps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP sc = new StorageServiceSCP(SOPClass.SecondaryCaptureImageStorage);

            sc.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP ct = new StorageServiceSCP(SOPClass.CTImageStorage);

            ct.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP ctEnhanced = new StorageServiceSCP(SOPClass.EnhancedCTImageStorage);

            ctEnhanced.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PrintServiceSCP grayscale = new PrintServiceSCP(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            PresentationLUTServiceSCP plut = new PresentationLUTServiceSCP();

            plut.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            AnnotationServiceSCP annotation = new AnnotationServiceSCP();

            annotation.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(dx1);
            server.AddService(dx2);
            server.AddService(cr);
            server.AddService(mg1);
            server.AddService(mg2);
            server.AddService(gsps);
            server.AddService(sc);
            server.AddService(ct);
            server.AddService(ctEnhanced);
            server.AddService(grayscale);
            server.AddService(plut);
            server.AddService(annotation);

            ImageStoredEventHandler imageHandler = new ImageStoredEventHandler(OnImageStored);

            foreach (ServiceClass service in server.Services)
            {
                if (service != null)
                {
                    if (service is StorageServiceSCP)
                    {
                        ((StorageServiceSCP)service).ImageStored += imageHandler;
                    }
                    else if (service is PrintServiceSCP)
                    {
                        ((PrintServiceSCP)service).JobPrinted += new PrintJobEventHandler(OnPagePrinted);
                    }
                }
            }

            server.Start();
        }
示例#16
0
        private static Server StartServer(ApplicationEntity host)
        {
            Server server = new Server(host.Title, host.Port);

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            PrintServiceSCP grayscale = new PrintServiceSCP(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            grayscale.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            PresentationLUTServiceSCP plut = new PresentationLUTServiceSCP();

            plut.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            plut.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            AnnotationServiceSCP annotation = new AnnotationServiceSCP();

            annotation.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            annotation.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(grayscale);
            server.AddService(plut);
            server.AddService(annotation);

            PrintJobEventHandler print_handler = new PrintJobEventHandler(OnPagePrinted);

            grayscale.JobPrinted += print_handler;

            StorageServiceSCP cr = new StorageServiceSCP(SOPClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            cr.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP dx1 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            dx1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            dx1.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP dx2 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForProcessing);

            dx2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            dx2.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP mg1 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForPresentation);

            mg1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            mg1.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP mg2 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForProcessing);

            mg2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            mg2.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP gsps = new StorageServiceSCP(SOPClass.GrayscaleSoftcopyPresentationStateStorageSOPClass);

            gsps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            gsps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP sc = new StorageServiceSCP(SOPClass.SecondaryCaptureImageStorage);

            sc.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            sc.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP dose = new StorageServiceSCP(SOPClass.XRayRadiationDoseSRStorage);

            dose.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            dose.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            ImageStoredEventHandler store_handler = new ImageStoredEventHandler(OnImageStored);

            cr.ImageStored   += store_handler;
            dx1.ImageStored  += store_handler;
            dx2.ImageStored  += store_handler;
            mg1.ImageStored  += store_handler;
            mg2.ImageStored  += store_handler;
            gsps.ImageStored += store_handler;
            sc.ImageStored   += store_handler;
            dose.ImageStored += store_handler;

            server.AddService(cr);
            server.AddService(dx1);
            server.AddService(dx2);
            server.AddService(mg1);
            server.AddService(mg2);
            server.AddService(gsps);
            server.AddService(sc);
            server.AddService(dose);

            MppsServiceSCP mpps = new MppsServiceSCP();

            mpps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            MppsEventHandler mpps_handler = new MppsEventHandler(OnMpps);

            mpps.MppsCreate += mpps_handler;
            mpps.MppsSet    += mpps_handler;

            server.AddService(mpps);

            server.Start();

            return(server);
        }
示例#17
0
        public static void Start(ApplicationEntity host, Dictionary <string, ApplicationEntity> stations)
        {
            if (server != null)
            {
                throw new Exception("StorageTest.Server in use.");
            }

            server = new Server(host.Title, host.Port);

            server.Hosts = stations;

            VerificationServiceSCP echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP cr = new StorageServiceSCP(SOPClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            cr.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP dx1 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            dx1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            dx1.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP dx2 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForProcessing);

            dx2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            dx2.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP mg1 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForPresentation);

            mg1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            mg1.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP mg2 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForProcessing);

            mg2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            mg2.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP gsps = new StorageServiceSCP(SOPClass.GrayscaleSoftcopyPresentationStateStorageSOPClass);

            gsps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            gsps.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageServiceSCP sc = new StorageServiceSCP(SOPClass.SecondaryCaptureImageStorage);

            sc.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            sc.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            StorageCommitServiceSCP commit = new StorageCommitServiceSCP();

            commit.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);
            commit.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            ImageStoredEventHandler handler = new ImageStoredEventHandler(OnImageStored);

            cr.ImageStored   += handler;
            dx1.ImageStored  += handler;
            dx2.ImageStored  += handler;
            mg1.ImageStored  += handler;
            mg2.ImageStored  += handler;
            gsps.ImageStored += handler;
            sc.ImageStored   += handler;

            commit.StorageCommitReport += new StorageCommitEventHandler(OnStorageCommit);

            server.AddService(echo);
            server.AddService(cr);
            server.AddService(dx1);
            server.AddService(dx2);
            server.AddService(mg1);
            server.AddService(mg2);
            server.AddService(gsps);
            server.AddService(sc);
            server.AddService(commit);

            server.Start();
        }
示例#18
0
        public bool StartService()
        {
            if (IsPortOpened())
            {
                MessageBox.Show("SCP is already running in another instance.");
                return(false);
            }

            server = new Server(AeTitle, Port);

            var echo = new VerificationServiceSCP();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var dx1 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            dx1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var dx2 = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForProcessing);

            dx2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var cr = new StorageServiceSCP(SOPClass.ComputedRadiographyImageStorage);

            cr.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var mg1 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForPresentation);

            mg1.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var mg2 = new StorageServiceSCP(SOPClass.DigitalMammographyImageStorageForProcessing);

            mg2.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var gsps = new StorageServiceSCP(SOPClass.GrayscaleSoftcopyPresentationStateStorageSOPClass);

            gsps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var sc = new StorageServiceSCP(SOPClass.SecondaryCaptureImageStorage);

            sc.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var ct = new StorageServiceSCP(SOPClass.CTImageStorage);

            ct.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var ctEnhanced = new StorageServiceSCP(SOPClass.EnhancedCTImageStorage);

            ctEnhanced.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var dose = new StorageServiceSCP(SOPClass.XRayRadiationDoseSRStorage);

            dose.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var find = new CFindServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelFIND);

            find.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var move = new CMoveServiceSCP(SOPClass.StudyRootQueryRetrieveInformationModelMOVE);

            move.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var mpps = new MppsServiceSCP();

            mpps.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var commit = new StorageCommitServiceSCP();

            commit.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var grayscale = new PrintServiceSCP(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            grayscale.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var plut = new PresentationLUTServiceSCP();

            plut.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            var annotation = new AnnotationServiceSCP();

            annotation.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            server.AddService(echo);
            server.AddService(dx1);
            server.AddService(dx2);
            server.AddService(cr);
            server.AddService(mg1);
            server.AddService(mg2);
            server.AddService(gsps);
            server.AddService(sc);
            server.AddService(ct);
            server.AddService(ctEnhanced);
            server.AddService(dose);
            server.AddService(find);
            server.AddService(move);
            server.AddService(mpps);
            server.AddService(commit);
            server.AddService(grayscale);
            server.AddService(plut);
            server.AddService(annotation);

            foreach (ServiceClass service in server.Services)
            {
                if (service != null)
                {
                    if (service is StorageServiceSCP)
                    {
                        ((StorageServiceSCP)service).ImageStored += OnImageStored;
                    }
                    else if (service is PrintServiceSCP)
                    {
                        ((PrintServiceSCP)service).JobPrinted += OnImagePrinted;
                    }
                    else if (service is MppsServiceSCP)
                    {
                        ((MppsServiceSCP)service).MppsCreate += OnMpps;
                        ((MppsServiceSCP)service).MppsSet    += OnMpps;
                    }
                    else if (service is StorageCommitServiceSCP)
                    {
                        ((StorageCommitServiceSCP)service).StorageCommitRequest += OnStorageCommitRequested;
                    }
                    else if (service is CFindServiceSCP)
                    {
                        ((CFindServiceSCP)service).Query += OnQuery;
                    }
                }
            }

            server.Start();

            return(true);
        }
示例#19
0
 public VerificationServiceSCP(VerificationServiceSCP other)
     : base(other)
 {
 }