Package org.dcm4che3.util

Examples of org.dcm4che3.util.Property


        assertTrue(
                "file or directory does not exists: " + file.getAbsolutePath(),
                file.exists());

        Device device = new Device("mppsscu");
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity("MPPSSCU");
        device.addApplicationEntity(ae);
        ae.addConnection(conn);

        final MppsSCU main = new MppsSCU(ae);
       
        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);
                        MppsTest.this.onNSetRSP(cmd);
                    }
                };
            }

        });

        // configure
        main.getAAssociateRQ().setCalledAET(aeTitle);
        main.getRemoteConnection().setHostname(host);
        main.getRemoteConnection().setPort(port);
        main.setTransferSyntaxes(new String[]{UID.ImplicitVRLittleEndian, UID.ExplicitVRLittleEndian, UID.ExplicitVRBigEndianRetired});
        main.setAttributes(new Attributes());

        // scan
        t1 = System.currentTimeMillis();
        main.scanFiles(Arrays.asList(file.getAbsolutePath()), false); //do not printout
        t2 = System.currentTimeMillis();

        // create executor
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        ScheduledExecutorService scheduledExecutorService = Executors
                .newSingleThreadScheduledExecutor();
        device.setExecutor(executorService);
        device.setScheduledExecutor(scheduledExecutorService);

        // open and send
        try {
            main.open();
View Full Code Here


        assertTrue(
                "file or directory does not exists: " + file.getAbsolutePath(),
                file.exists());

        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);

        main.setRspHandlerFactory(new StoreSCU.RSPHandlerFactory() {

            @Override
            public DimseRSPHandler createDimseRSPHandler(final File f) {

                return new DimseRSPHandler(0) {

                    @Override
                    public void onDimseRSP(Association as, Attributes cmd,
                            Attributes data) {
                        super.onDimseRSP(as, cmd, data);
                        StoreTest.this.onCStoreRSP(cmd, f);
                    }
                };
            }

        });

        // configure
        main.getAAssociateRQ().setCalledAET(aeTitle);
        main.getRemoteConnection().setHostname(host);
        main.getRemoteConnection().setPort(port);

        // specify attributes added to the sent object(s). attr can be
        // specified by keyword or tag value (in hex), e.g. PatientName
        // or 00100010. Attributes in nested Datasets can be specified
        // by including the keyword/tag value of the sequence attribute,
        // e.g. 00400275/00400009 for Scheduled Procedure Step ID in
        // the Request Attributes Sequence.

        String[] attributes = new String[0];
        main.setAttributes(new Attributes());
        CLIUtils.addAttributes(main.getAttributes(), attributes);

        // scan
        t1 = System.currentTimeMillis();
        main.scanFiles(Arrays.asList(file.getAbsolutePath()), false); // do not
                                                                      // printout
        t2 = System.currentTimeMillis();

        // create executor
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        ScheduledExecutorService scheduledExecutorService = Executors
                .newSingleThreadScheduledExecutor();
        device.setExecutor(executorService);
        device.setScheduledExecutor(scheduledExecutorService);

        // open and send
        try {
            main.open();
View Full Code Here

*/
public class EchoSCP implements Processor {

    public static void main(String[] args) throws Exception {
        LdapDicomConfiguration dicomConf = new LdapDicomConfiguration();
        Device device = dicomConf.findDevice(args[0]);
        Main main = new Main();
        main.bind("dicomDevice", new DicomDeviceComponent(device));
        main.addRouteBuilder(new RouteBuilder(){

            @Override
View Full Code Here

            throws IncompatibleConnectionException {
        ActiveConnection activeConnection = this.activeConnection;
        if (activeConnection != null)
            return activeConnection;

        Device arrDev = this.arrDevice;
        if (arrDevice == null)
            throw new IllegalStateException("No AuditRecordRepositoryDevice initalized");

        AuditRecordRepository arr = arrDev.getDeviceExtension(AuditRecordRepository.class);
        if (arr == null)
            throw new IllegalStateException("AuditRecordRepositoryDevice "
                    + arrDevice.getDeviceName()
                    + " does not provide Audit Record Repository");
View Full Code Here

    }

    @Override
    public void process(Exchange exchange) throws Exception {
        DicomMessage in = exchange.getIn(DicomMessage.class);
        Dimse dimse = in.getHeader("dimse", Dimse.class);
        if (dimse != Dimse.C_ECHO_RQ)
            throw new DicomServiceException(Status.UnrecognizedOperation);
        DicomMessage out = new DicomMessage(
                Dimse.C_ECHO_RSP,
                Commands.mkEchoRSP(in.getCommand(), Status.Success));
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

        main.setRspHandlerFactory(new StoreSCU.RSPHandlerFactory() {

            @Override
            public DimseRSPHandler createDimseRSPHandler(final File f) {

                return new DimseRSPHandler(0) {

                    @Override
                    public void onDimseRSP(Association as, Attributes cmd,
                            Attributes data) {
                        super.onDimseRSP(as, cmd, data);
View Full Code Here

                        return (this.activeConnection =
                                conn.getProtocol().isTCP()
                                ? new TCPConnection(conn, remoteConn)
                                : new UDPConnection(conn, remoteConn));
                     }
        throw new IncompatibleConnectionException(
                "No compatible connection to " + arr + " available on " + this);
    }
View Full Code Here

    private static void configureTransferCapability(ApplicationEntity ae,
            CommandLine cl) throws IOException {
        if (cl.hasOption("accept-unknown")) {
            ae.addTransferCapability(
                    new TransferCapability(null,
                            "*",
                            TransferCapability.Role.SCP,
                            "*"));
        } else {
            Properties p = CLIUtils.loadProperties(
                    cl.getOptionValue("sop-classes",
                            "resource:sop-classes.properties"),
                    null);
            for (String cuid : p.stringPropertyNames()) {
                String ts = p.getProperty(cuid);
                TransferCapability tc = new TransferCapability(null,
                        CLIUtils.toUID(cuid),
                        TransferCapability.Role.SCP,
                        CLIUtils.toUIDs(ts));
                ae.addTransferCapability(tc);
            }
View Full Code Here

TOP

Related Classes of org.dcm4che3.util.Property

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.