Package org.dcm4che3.conf.api.generic

Examples of org.dcm4che3.conf.api.generic.ConfigClass


        item.setString(Tag.TextValue, VR.UT, keyObjectDescription);
        return item;
    }

    private Attributes contentItem(String valueType, Attributes refSOP) {
        Attributes item = new Attributes(3);
        item.setString(Tag.RelationshipType, VR.CS, "CONTAINS");
        item.setString(Tag.ValueType, VR.CS, valueType);
        item.newSequence(Tag.ReferencedSOPSequence, 1).add(refSOP);
        return item;
    }
View Full Code Here


            stgcmtscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
            stgcmtscu.setStatus(CLIUtils.getIntOption(cl, "status", 0));
            stgcmtscu.setSplitTag(getSplitTag(cl));
            stgcmtscu.setKeepAlive(cl.hasOption("keep-alive"));
            stgcmtscu.setStorageDirectory(getStorageDirectory(cl));
            stgcmtscu.setAttributes(new Attributes());
            CLIUtils.addAttributes(stgcmtscu.attrs, cl.getOptionValues("s"));
            stgcmtscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
            List<String> argList = cl.getArgList();
            boolean echo = argList.isEmpty();
            if (!echo) {
View Full Code Here

            }
        }
    }

    public Attributes makeActionInfo(List<String> refSOPs) {
        Attributes actionInfo = new Attributes(2);
        actionInfo.setString(Tag.TransactionUID, VR.UI, UIDUtils.createUID());
        int n = refSOPs.size() / 2;
        Sequence refSOPSeq = actionInfo.newSequence(Tag.ReferencedSOPSequence, n);
        for (int i = 0, j = 0; j < n; j++) {
            Attributes refSOP = new Attributes(2);
            refSOP.setString(Tag.ReferencedSOPClassUID, VR.UI, refSOPs.get(i++));
            refSOP.setString(Tag.ReferencedSOPInstanceUID, VR.UI, refSOPs.get(i++));
            refSOPSeq.add(refSOP);
        }
        return actionInfo;
    }
View Full Code Here

        // 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();
View Full Code Here

        // 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
View Full Code Here

            throw new IllegalStateException("IOD net initialized");
        DicomInputStream dis = null;
        try {
            System.out.print("Validate: " + file + " ... ");
            dis = new DicomInputStream(file);
            Attributes attrs = dis.readDataset(-1, -1);
            ValidationResult result = attrs.validate(iod);
            if (result.isValid())
                System.out.println("OK");
            else {
                System.out.println("FAILED:");
                System.out.println(result.asText(attrs));
View Full Code Here

                    "Unsupported SOP Class: " + mfcuid);
        return impl;
    }

    private Attributes extract(Attributes emf, int frame, String cuid) {
        Attributes sfgs = emf.getNestedDataset(Tag.SharedFunctionalGroupsSequence);
        if (sfgs == null)
            throw new IllegalArgumentException(
                    "Missing (5200,9229) Shared Functional Groups Sequence");
        Attributes fgs = emf.getNestedDataset(Tag.PerFrameFunctionalGroupsSequence, frame);
        if (fgs == null)
            throw new IllegalArgumentException(
                    "Missing (5200,9230) Per-frame Functional Groups Sequence Item for frame #" + (frame + 1));
        Attributes dest = new Attributes(emf.size() * 2);
        dest.addNotSelected(emf, EXCLUDE_TAGS);
        addFunctionGroups(dest, sfgs);
        addFunctionGroups(dest, fgs);
        addPixelData(dest, emf, frame);
        dest.setString(Tag.SOPClassUID, VR.UI, cuid);
        dest.setString(Tag.SOPInstanceUID, VR.UI, uidMapper.get(
                dest.getString(Tag.SOPInstanceUID)) + '.' + (frame + 1));
        dest.setString(Tag.InstanceNumber, VR.IS,
                createInstanceNumber(dest.getString(Tag.InstanceNumber, ""), frame));
        dest.setString(Tag.ImageType, VR.CS, dest.getStrings(Tag.FrameType));
        dest.remove(Tag.FrameType);
        if (!preserveSeriesInstanceUID)
            dest.setString(Tag.SeriesInstanceUID, VR.UI, uidMapper.get(
                    dest.getString(Tag.SeriesInstanceUID)));
        adjustReferencedImages(dest, Tag.ReferencedImageSequence);
        adjustReferencedImages(dest, Tag.SourceImageSequence);
        return dest;
    }
View Full Code Here

        if (sq == null)
            return;
       
        ArrayList<Attributes> newRefs = new ArrayList<Attributes>();
        for (Iterator<Attributes> itr = sq.iterator(); itr.hasNext();) {
            Attributes ref = (Attributes) itr.next();
            String cuid = legacySOPClassUID(ref.getString(Tag.ReferencedSOPClassUID));
            if (cuid == null)
                continue;

            itr.remove();
            String iuid = uidMapper.get(ref.getString(Tag.ReferencedSOPInstanceUID));
            int[] frames = ref.getInts(Tag.ReferencedFrameNumber);
            int n = frames == null ? nofAccessor.getNumberOfFrames(iuid)
                                   : frames.length;
            ref.remove(Tag.ReferencedFrameNumber);
            ref.setString(Tag.ReferencedSOPClassUID, VR.UI, cuid);
            for (int i = 0; i < n; i++) {
                Attributes newRef = new Attributes(ref);
                newRef.setString(Tag.ReferencedSOPInstanceUID, VR.UI,
                        iuid + '.' + (frames != null ? frames[i] : (i+1)));
                newRefs.add(newRef);
            }
        }
        for (Attributes ref : newRefs)
View Full Code Here

            sq.add(ref);
    }

    private void addFunctionGroups(Attributes dest, Attributes fgs) {
        dest.addSelected(fgs, Tag.ReferencedImageSequence);
        Attributes fg;
        for (int sqTag : fgs.tags())
            if (sqTag != Tag.ReferencedImageSequence
                    && (fg = fgs.getNestedDataset(sqTag)) != null)
                dest.addAll(fg);
    }
View Full Code Here

                + "{\"BulkDataURI\":\"file:/PixelData\"}"
            + "]}}";

    @Test
    public void test() {
        Attributes dataset = new Attributes();
        dataset.setString(Tag.SpecificCharacterSet, VR.CS, null, "ISO 2022 IR 87");
        dataset.setString(Tag.ImageType, VR.CS, "DERIVED", "PRIMARY");
        Attributes item = new Attributes(2);
        dataset.newSequence(Tag.SourceImageSequence, 1).add(item);
        item.setString(Tag.ReferencedSOPClassUID, VR.UI, UID.CTImageStorage);
        item.setString(Tag.ReferencedSOPInstanceUID, VR.UI, "1.2.3.4");
        dataset.setString(Tag.PatientName, VR.PN, "af^ag=if^ig=pf^pg");
        dataset.setBytes("PRIVATE", 0x00090002, VR.OB, BYTE01);
        dataset.setDouble(Tag.FrameTime, VR.DS, 33.0);
        dataset.setInt(Tag.SamplesPerPixel, VR.US, 1);
        dataset.setInt(Tag.NumberOfFrames, VR.IS, 1);
View Full Code Here

TOP

Related Classes of org.dcm4che3.conf.api.generic.ConfigClass

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.