Package org.dcm4che3.io

Examples of org.dcm4che3.io.DicomOutputStream.writeHeader()


        @SuppressWarnings("resource")
        DicomOutputStream dout = new DicomOutputStream(out,
                bigEndian ? UID.ExplicitVRBigEndianRetired
                          : UID.ExplicitVRLittleEndian);
        dout.writeDataset(null, this);
        dout.writeHeader(Tag.ItemDelimitationItem, null, 0);
    }

    private void readObject(ObjectInputStream in)
            throws IOException, ClassNotFoundException {
        in.defaultReadObject();
View Full Code Here


            attrs.setDate(Tag.InstanceCreationDate, VR.DA, now);
            attrs.setDate(Tag.InstanceCreationTime, VR.TM, now);
            Attributes fmi = attrs.createFileMetaInformation(transferSyntax);
            DicomOutputStream dos = new DicomOutputStream(dcmFile);
            try {
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeHeader(Tag.AcquisitionContextSequence, VR.SQ, -1);
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
View Full Code Here

            attrs.setDate(Tag.InstanceCreationTime, VR.TM, now);
            Attributes fmi = attrs.createFileMetaInformation(transferSyntax);
            DicomOutputStream dos = new DicomOutputStream(dcmFile);
            try {
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeHeader(Tag.AcquisitionContextSequence, VR.SQ, -1);
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
                    dos.writeHeader(Tag.Item, null, 0);
View Full Code Here

            Attributes fmi = attrs.createFileMetaInformation(transferSyntax);
            DicomOutputStream dos = new DicomOutputStream(dcmFile);
            try {
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeHeader(Tag.AcquisitionContextSequence, VR.SQ, -1);
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
                    dos.writeHeader(Tag.Item, null, 0);
                    dos.writeHeader(Tag.Item, null, (jpgLen + 1) & ~1);
View Full Code Here

            try {
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeHeader(Tag.AcquisitionContextSequence, VR.SQ, -1);
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
                    dos.writeHeader(Tag.Item, null, 0);
                    dos.writeHeader(Tag.Item, null, (jpgLen + 1) & ~1);
                    dos.write(buffer, 0, jpgHeaderLen);
                }
View Full Code Here

                dos.writeHeader(Tag.AcquisitionContextSequence, VR.SQ, -1);
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
                    dos.writeHeader(Tag.Item, null, 0);
                    dos.writeHeader(Tag.Item, null, (jpgLen + 1) & ~1);
                    dos.write(buffer, 0, jpgHeaderLen);
                }
                int r;
                while ((r = jpgInput.read(buffer)) > 0) {
View Full Code Here

                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
                dos.writeDataset(fmi, attrs);
                dos.writeHeader(Tag.PixelData, VR.OB, -1);
                if (!cl.hasOption("mpeg")) {
                    dos.writeHeader(Tag.Item, null, 0);
                    dos.writeHeader(Tag.Item, null, (jpgLen + 1) & ~1);
                    dos.write(buffer, 0, jpgHeaderLen);
                }
                int r;
                while ((r = jpgInput.read(buffer)) > 0) {
                    dos.write(buffer, 0, r);
View Full Code Here

                if (!cl.hasOption("mpeg")) {
                    if ((jpgLen & 1) != 0) {
                        dos.write(0);
                    }
                }
                dos.writeHeader(Tag.SequenceDelimitationItem, null, 0);
            } finally {
                dos.close();
            }
        } finally {
            jpgInput.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.