Package org.dcm4che3.data

Examples of org.dcm4che3.data.Code


            Attributes frameFctGroups,
            int tag) {
        if (frameFctGroups == null) {
            return imgAttrs;
        }
        Attributes group = frameFctGroups.getNestedDataset(tag);
        if (group == null && sharedFctGroups != null) {
            group = sharedFctGroups.getNestedDataset(tag);
        }
        return group != null ? group : imgAttrs;
    }
View Full Code Here


        dis = new DicomInputStream(new ImageInputStreamAdapter(iis));
        dis.setIncludeBulkData(IncludeBulkData.URI);
        dis.setBulkDataDescriptor(BulkDataDescriptor.PIXELDATA);
        dis.setURI("java:iis"); // avoid copy of pixeldata to temporary file
        Attributes fmi = dis.readFileMetaInformation();
        Attributes ds = dis.readDataset(-1, -1);
        metadata = new DicomMetaData(fmi, ds);
        Object pixeldata = ds.getValue(Tag.PixelData, pixeldataVR );
        if (pixeldata != null) {
            frames = ds.getInt(Tag.NumberOfFrames, 1);
            width = ds.getInt(Tag.Columns, 0);
            height = ds.getInt(Tag.Rows, 0);
            samples = ds.getInt(Tag.SamplesPerPixel, 1);
            banded = samples > 1 && ds.getInt(Tag.PlanarConfiguration, 0) != 0;
            bitsAllocated = ds.getInt(Tag.BitsAllocated, 8);
            bitsStored = ds.getInt(Tag.BitsStored, bitsAllocated);
            dataType = bitsAllocated <= 8 ? DataBuffer.TYPE_BYTE
                                          : DataBuffer.TYPE_USHORT;
            pmi = PhotometricInterpretation.fromString(
                    ds.getString(Tag.PhotometricInterpretation, "MONOCHROME2"));
            if (pixeldata instanceof BulkData) {
                iis.setByteOrder(ds.bigEndian()
                        ? ByteOrder.BIG_ENDIAN
                        : ByteOrder.LITTLE_ENDIAN);
                this.frameLength = pmi.frameLength(width, height, samples, bitsAllocated);
                this.pixeldata = (BulkData) pixeldata;
            } else {
View Full Code Here

        }
    }

    private BulkData extractPixelData(BulkData src, int frame,
            int length) {
        return new BulkData(src.uriWithoutOffsetAndLength(),
                src.offset + frame * length, length,
                src.bigEndian);
    }
View Full Code Here

        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);
        dataset.setInt(Tag.FrameIncrementPointer, VR.AT, Tag.FrameTime);
        dataset.setValue(Tag.OverlayData, VR.OW, new BulkData(null, "file:/OverlayData", false));
        Fragments frags = dataset.newFragments(Tag.PixelData, VR.OB, 2);
        frags.add(null);
        frags.add(new BulkData(null, "file:/PixelData", false));
        StringWriter writer = new StringWriter();
        JsonGenerator gen = Json.createGenerator(writer);
        new JSONWriter(gen).write(dataset);
        gen.flush();
        assertEquals(RESULT, writer.toString());
View Full Code Here

    }

    private static String[] toStringArray(EventID... a) {
        String[] ss = new String[a.length];
        for (int i = 0; i < a.length; i++) {
            ss[i] = new Code(
                    a[i].getCode(),
                    a[i].getCodeSystemName(),
                    null,
                    a[i].getDisplayName())
                .toString();
View Full Code Here

    }

    private static String[] toStringArray(EventTypeCode... a) {
        String[] ss = new String[a.length];
        for (int i = 0; i < a.length; i++) {
            ss[i] = new Code(
                    a[i].getCode(),
                    a[i].getCodeSystemName(),
                    null,
                    a[i].getDisplayName())
                .toString();
View Full Code Here

    }

    private static String[] toStringArray(RoleIDCode... a) {
        String[] ss = new String[a.length];
        for (int i = 0; i < a.length; i++) {
            ss[i] = new Code(
                    a[i].getCode(),
                    a[i].getCodeSystemName(),
                    null,
                    a[i].getDisplayName())
                .toString();
View Full Code Here

    }

    private static EventID[] toEventIDArray(String... ss) {
        EventID[] a = new EventID[ss.length];
        for (int i = 0; i < ss.length; i++) {
            Code code = new Code(ss[i]);
            a[i] = new EventID();
            a[i].setCode(code.getCodeValue());
            a[i].setCodeSystemName(code.getCodingSchemeDesignator());
            a[i].setDisplayName(code.getCodeMeaning());
        }
        return a;
    }
View Full Code Here

    }

    private static EventTypeCode[] toEventTypeCodeArray(String... ss) {
        EventTypeCode[] a = new EventTypeCode[ss.length];
        for (int i = 0; i < ss.length; i++) {
            Code code = new Code(ss[i]);
            a[i] = new EventTypeCode();
            a[i].setCode(code.getCodeValue());
            a[i].setCodeSystemName(code.getCodingSchemeDesignator());
            a[i].setDisplayName(code.getCodeMeaning());
        }
        return a;
    }
View Full Code Here

    }

    private static RoleIDCode[] toRoleIDCodeArray(String... ss) {
        RoleIDCode[] a = new RoleIDCode[ss.length];
        for (int i = 0; i < ss.length; i++) {
            Code code = new Code(ss[i]);
            a[i] = new RoleIDCode();
            a[i].setCode(code.getCodeValue());
            a[i].setCodeSystemName(code.getCodingSchemeDesignator());
            a[i].setDisplayName(code.getCodeMeaning());
        }
        return a;
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.data.Code

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.