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(); }
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(); }
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(); }
static RecordCollection query(string level, Elements filter) { CFindServiceSCP service = new CFindServiceSCP(SOPClass.PatientRootQueryRetrieveInformationModelFIND); filter.Set(t.QueryRetrieveLevel, level); return(service.InternalQuery(filter)); }
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(); }
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(); } }
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); }
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(); }