Package org.dcm4che3.data

Examples of org.dcm4che3.data.ItemPointer


            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

                    (byte[]) pixelData, frame, calcFrameLength(src)));
        } else if (pixelData instanceof BulkData) {
            dest.setValue(Tag.PixelData, vr.vr, extractPixelData(
                    (BulkData) pixelData, frame, calcFrameLength(src)));
        } else {
            Fragments destFrags = dest.newFragments(Tag.PixelData, vr.vr, 2);
            destFrags.add(null);
            destFrags.add(((Fragments) pixelData).get(frame + 1));
        }
    }
View Full Code Here

        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

            "DicomAttribute[@tag=\"00400275\"]/Item[@number=\"1\"]/"
          + "DicomAttribute[@tag=\"0020000D\"]/Value[@number=\"1\"]";

    @Test
    public void testToString() {
        ItemPointer ip = new ItemPointer(Tag.RequestAttributesSequence);
        ValueSelector vs = new ValueSelector(Tag.StudyInstanceUID, null, null, 0, ip);
        assertEquals(XPATH, vs.toString());
    }
View Full Code Here

        assertEquals(Tag.StudyInstanceUID, vs.tag);
        assertNull(vs.privateCreator);
        assertNull(vs.vr);
        assertEquals(0, vs.valueIndex);
        assertEquals(1, vs.itemPointers.length);
        ItemPointer ip = vs.itemPointers[0];
        assertEquals(Tag.RequestAttributesSequence, ip.sequenceTag);
        assertNull(ip.privateCreator);
        assertEquals(0, ip.itemIndex);
    }
View Full Code Here

    public boolean isBulkDataFragment(Fragments frags) {
        if (tag != Tag.Item)
            return false;
       
        int last = itemPointers.size() - 1;
        ItemPointer ip = itemPointers.get(last);
        return bulkDataDescriptor.isBulkData(itemPointers.subList(0, last),
                ip.privateCreator, ip.sequenceTag, frags.vr(), length);
    }
View Full Code Here

    }

    private void addItemPointer(int sqtag, String privateCreator, int itemIndex) {
        if (itemPointers == null)
            itemPointers = new ArrayList<ItemPointer>(8);
        itemPointers.add(new ItemPointer(sqtag, privateCreator, itemIndex));
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.data.ItemPointer

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.