Package org.dcm4che3.data

Examples of org.dcm4che3.data.Attributes


        assertEquals(3, attrs.getInt(Tag.SamplesPerPixel, 0));
    }

    @Test
    public void testImplicitVR() throws Exception {
        Attributes attrs = readFromResource("OT-PAL-8-face", IncludeBulkData.URI);
        assertEquals(1, attrs.getInt(Tag.SamplesPerPixel, 0));
    }
View Full Code Here


        return new BulkDataDescriptor() {

            @Override
            public boolean isBulkData(List<ItemPointer> itemPointer,
                    String privateCreator, int tag, VR vr, int length) {
                Attributes item = blkAttrs;
                for (ItemPointer ip : itemPointer) {
                    item = item.getNestedDataset(
                            ip.privateCreator, ip.sequenceTag, ip.itemIndex);
                }
                return item.contains(privateCreator, tag);
            }
        };
    }
View Full Code Here

                rec.getInt(Tag.OffsetOfReferencedLowerLevelDirectoryEntity, 0));
    }

    protected Attributes findLastLowerDirectoryRecord(Attributes rec)
            throws IOException {
        Attributes lower = readLowerDirectoryRecord(rec);
        if (lower == null)
            return null;

        Attributes next;
        while ((next = readNextDirectoryRecord(lower)) != null)
            lower = next;
        return lower;
    }
View Full Code Here

            throws IOException {
        return findRootDirectoryRecord(ignorePrivate, pk(iuids), false, false);
    }

    private Attributes pk(String type, int tag, VR vr, String... ids) {
        Attributes pk = new Attributes(2);
        pk.setString(Tag.DirectoryRecordType, VR.CS, type);
        if (ids != null && ids.length != 0)
            pk.setString(tag, vr, ids);
        return pk;
    }
View Full Code Here

    private Attributes pk(String... iuids) {
        if (iuids == null || iuids.length == 0)
            return null;

        Attributes pk = new Attributes(1);
        pk.setString(Tag.ReferencedSOPInstanceUIDInFile, VR.UI, iuids);
        return pk;
    }
View Full Code Here

    private Attributes findRecordInUse(int offset, boolean ignorePrivate, Attributes keys,
            boolean ignoreCaseOfPN, boolean matchNoValue)
            throws IOException {
        while (offset != 0) {
            Attributes item = readRecord(offset);
            if (inUse(item) && !(ignorePrivate && isPrivate(item))
                    && (keys == null || item.matches(keys, ignoreCaseOfPN, matchNoValue)))
                return item;
            offset = item.getInt(Tag.OffsetOfTheNextDirectoryRecord, 0);
        }
        return null;
    }
View Full Code Here

    private synchronized Attributes readRecord(int offset) throws IOException {
        if (offset == 0)
            return null;

        Attributes item = cache.get(offset);
        if (item == null) {
            long off = offset & 0xffffffffL;
            raf.seek(off);
            in.setPosition(off);
            item = in.readItem();
View Full Code Here

public class SAXReader {

    public static Attributes parse(String uri, Attributes attrs)
            throws ParserConfigurationException, SAXException, IOException {
        if (attrs == null)
            attrs = new Attributes();
        SAXParserFactory f = SAXParserFactory.newInstance();
        SAXParser parser = f.newSAXParser();
        parser.parse(uri, new ContentHandlerAdapter(attrs));
        return attrs;
    }
View Full Code Here

    }

    public static Attributes parse(InputStream is, Attributes attrs)
            throws ParserConfigurationException, SAXException, IOException {
        if (attrs == null)
            attrs = new Attributes();
        SAXParserFactory f = SAXParserFactory.newInstance();
        SAXParser parser = f.newSAXParser();
        parser.parse(is, new ContentHandlerAdapter(attrs));
        return attrs;
    }
View Full Code Here

            writeFileMetaInformation(fmi);
        if (dataset.bigEndian() != bigEndian
                || encOpts.groupLength
                || !encOpts.undefSequenceLength
                || !encOpts.undefItemLength)
            dataset = new Attributes(dataset, bigEndian);
        if (encOpts.groupLength)
            dataset.calcLength(encOpts, explicitVR);
        dataset.writeTo(this);
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.data.Attributes

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.