Package org.dcm4che3.net

Examples of org.dcm4che3.net.Device


        return serviceRegistry;
    }

    public void init() {
        try {
            Device device = dicomConfiguration.findDevice(deviceName);
            init(device);
            device.setDimseRQHandler(serviceRegistry);
            start();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here


                b.getUserIsRequestor());
        return mods;
    }

    private String arrDeviceRef(AuditLogger a) {
        Device arrDevice = a.getAuditRecordRepositoryDevice();
        return arrDevice != null
                ? config.deviceRef(arrDevice.getDeviceName())
                : null;
    }
View Full Code Here

    @Test
    public void testPersist() throws Exception {
        try {
            config.removeDevice("Test-Device-1");
        catch (ConfigurationNotFoundException e) {}
        Device device = createDevice("Test-Device-1", "TEST-AET1");
        config.persist(device);
        ApplicationEntity ae = config.findApplicationEntity("TEST-AET1");
        assertFalse(ae.isAssociationInitiator());
        assertTrue(ae.isAssociationAcceptor());
        assertTrue(ae.getConnections().get(0).isServer());
View Full Code Here

    @Test
    public void testMerge() throws Exception {
        try {
            config.removeDevice("Test-Device-1");
        catch (ConfigurationNotFoundException e) {}
        Device device = createDevice("Test-Device-1", "TEST-AET1");
        config.persist(device);
        modifyDevice(device);
        config.merge(device);
        ApplicationEntity ae2 = config.findApplicationEntity("TEST-AET2");
        ApplicationEntity ae = ae2.getDevice().getApplicationEntity("TEST-AET1");
View Full Code Here

                findSCP.getQueryOptions());
        config.removeDevice("Test-Device-1");
    }

    private static Device createDevice(String name, String aet) throws Exception {
        Device device = new Device(name);
        Connection conn = createConn("host.dcm4che.org", 11112);
        device.addConnection(conn);
        ApplicationEntity ae = createAE(aet, conn);
        device.addApplicationEntity(ae);
        return device ;
    }
View Full Code Here

        device.addApplicationEntity(ae2);
    }

    @Test
    public void testTimeZoneConversion() throws Exception  {
        Device modalityInChina = createDevice("modalityInChina", "modalityInChina");
        modalityInChina.setTimeZoneOfDevice(TimeZone.getTimeZone("Asia/Shanghai"));
        Device archiveInAustria = createDevice("archiveInAustria", "archiveInAustria");
        archiveInAustria.setTimeZoneOfDevice(TimeZone.getTimeZone("Europe/Vienna"));
        if(!config.exists("dicomDeviceName=modalityInChina,cn=Devices,cn=DICOM Configuration,dc=example,dc=com"))
            config.persist(modalityInChina);
        if(!config.exists("dicomDeviceName=archiveInAustria,cn=Devices,cn=DICOM Configuration,dc=example,dc=com"))
            config.persist(archiveInAustria);
       
        TimeZone a = modalityInChina.getTimeZoneOfDevice();
        TimeZone b = archiveInAustria.getTimeZoneOfDevice();
        Attributes attr = new Attributes();
        attr.setDefaultTimeZone(a);
        attr.setTimezone(a);
        Calendar cal = Calendar.getInstance();
        //no daylight saving
View Full Code Here

    }

    @Override
    public HL7Application findHL7Application(String name)
            throws ConfigurationException {
        Device device = config.findDevice("hl7Application", name);
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        return hl7Ext.getHL7Application(name);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        long t1, t2;
        try {
            CommandLine cl = parseComandLine(args);
            Device device = new Device("storescu");
            Connection conn = new Connection();
            device.addConnection(conn);
            ApplicationEntity ae = new ApplicationEntity("STORESCU");
            device.addApplicationEntity(ae);
            ae.addConnection(conn);
            StoreSCU main = new StoreSCU(ae);
            configureTmpFile(main, cl);
            CLIUtils.configureConnect(main.remote, main.rq, cl);
            CLIUtils.configureBind(conn, ae, cl);
            CLIUtils.configure(conn, cl);
            main.remote.setTlsProtocols(conn.getTlsProtocols());
            main.remote.setTlsCipherSuites(conn.getTlsCipherSuites());
            configureRelatedSOPClass(main, cl);
            main.setAttributes(new Attributes());
            CLIUtils.addAttributes(main.attrs, cl.getOptionValues("s"));
            main.setUIDSuffix(cl.getOptionValue("uid-suffix"));
            main.setPriority(CLIUtils.priorityOf(cl));
            List<String> argList = cl.getArgList();
            boolean echo = argList.isEmpty();
            if (!echo) {
                System.out.println(rb.getString("scanning"));
                t1 = System.currentTimeMillis();
                main.scanFiles(argList);
                t2 = System.currentTimeMillis();
                int n = main.filesScanned;
                System.out.println();
                if (n == 0)
                    return;
                System.out.println(MessageFormat.format(
                        rb.getString("scanned"), n, (t2 - t1) / 1000F,
                        (t2 - t1) / n));
            }
            ExecutorService executorService = Executors
                    .newSingleThreadExecutor();
            ScheduledExecutorService scheduledExecutorService = Executors
                    .newSingleThreadScheduledExecutor();
            device.setExecutor(executorService);
            device.setScheduledExecutor(scheduledExecutorService);
            try {
                t1 = System.currentTimeMillis();
                main.open();
                t2 = System.currentTimeMillis();
                System.out.println(MessageFormat.format(
View Full Code Here

            sendRequest(makeActionInfo(refSOPs));
    }

    private void sendRequest(Attributes actionInfo) throws IOException, InterruptedException {
        final String tuid = actionInfo.getString(Tag.TransactionUID);
        DimseRSPHandler rspHandler = new DimseRSPHandler(as.nextMessageID()) {

            @Override
            public void onDimseRSP(Association as, Attributes cmd, Attributes data) {
                if (cmd.getInt(Tag.Status, -1) != Status.Success)
                    removeOutstandingResult(tuid );
View Full Code Here

        main.setRspHandlerFactory(new MppsSCU.RSPHandlerFactory() {

            @Override
            public DimseRSPHandler createDimseRSPHandlerForNCreate(final MppsSCU.MppsWithIUID mppsWithUID) {

                return new DimseRSPHandler(0) {

                    @Override
                    public void onDimseRSP(Association as, Attributes cmd,
                            Attributes data) {
                       
                        switch(cmd.getInt(Tag.Status, -1)) {
                        case Status.Success:
                        case Status.AttributeListError:
                        case Status.AttributeValueOutOfRange:
                            mppsWithUID.iuid = cmd.getString(
                                    Tag.AffectedSOPInstanceUID, mppsWithUID.iuid);
                            main.addCreatedMpps(mppsWithUID);
                        }
                       
                        super.onDimseRSP(as, cmd, data);
                        MppsTest.this.onNCreateRSP(cmd);
                    }
                };
            }
           
            @Override
            public DimseRSPHandler createDimseRSPHandlerForNSet() {
               
                return new DimseRSPHandler(0) {
                   
                    @Override
                    public void onDimseRSP(Association as, Attributes cmd, Attributes data) {
                       
                        super.onDimseRSP(as, cmd, data);
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.Device

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.