congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DicomOutputStream.write
Code IndexAdd Tabnine to your IDE (free)

How to use
write
method
in
org.dcm4che2.io.DicomOutputStream

Best Java code snippets using org.dcm4che2.io.DicomOutputStream.write (Showing top 7 results out of 315)

origin: dcm4che/dcm4che-core

public void writeFileMetaInformation(DicomObject attrs) throws IOException {
  if (preamble != null) {
    write(preamble, 0, PREAMBLE_LENGTH);
    write('D');
    write('I');
    write('C');
    write('M');
  }
  this.ts = TransferSyntax.ExplicitVRLittleEndian;
  writeElements(attrs.fileMetaInfoIterator(), true, new ItemInfo(attrs
      .fileMetaInfoIterator(), true));
}
origin: dcm4che/dcm4che-imageio

/**
 * Write the given image as a byte array to the sequence.
 */
public void writeBytesToSequence(byte[] data, ImageWriteParam param)
    throws IOException {
  if (encapsulated) {
    dos.writeHeader(Tag.Item, null, (data.length+1) & ~1);
  }
  dos.write(data);
  if ((data.length & 1) != 0)
    dos.write(0);
  // The flush allows any memory buffer to be cleared.
  dos.flush();
  ((ImageOutputStream) output).flush();
}
origin: dcm4che/dcm4che-core

    byte[] val = a.getFragment(i);
    writeHeader(Tag.Item, null, (val.length + 1) & ~1);
    write(val);
    if ((val.length & 1) != 0)
      write(0);
write(val);
if ((val.length & 1) != 0)
  write(vr.padding());
origin: dcm4che/dcm4che-core

private void transcodeValue(DicomInputStream in, VR vr)
throws IOException
{
  boolean toggleEndian = out.getTransferSyntax().bigEndian()
             != in.getTransferSyntax().bigEndian();
  int remaining = in.valueLength();
  while (remaining > 0)
  {
    int len = Math.min(remaining, buf.length);
    in.readFully(buf, 0, len);
    if (toggleEndian)
      vr.toggleEndian(buf, 0, len);
    out.write(buf, 0, len);
    remaining -= len;
  }
}
origin: dcm4che/dcm4che-core

private void writeGroupLength(int tag, int length) throws IOException {
  writeHeader(tag, VR.UL, 4);
  write(VR.UL.toBytes(length, ts.bigEndian()), 0, 4);
}
origin: dcm4che/dcm4che-core

      ByteUtils.ushort2bytesLE(len, header, 6);
    write(header, 0, 8);
    return;
  write(header, 0, 8);
  off = 4;
  ByteUtils.int2bytesLE(len, header, 4);
write(header, off, 8 - off);
origin: dcm4che/dcm4che-core

private void transcodeAttribute(DicomInputStream in) 
throws IOException
{
  final int tag = in.tag();
  final VR vr = in.vr();
  final int vallen = in.valueLength();
  final DicomObject attrs = in.getDicomObject();
  if (vallen == -1 || vr == VR.SQ) {
    out.writeHeader(tag, vr, -1);
    TransferSyntax prevTS = out.getTransferSyntax();
    if (vr == VR.UN) {
      out.setTransferSyntax(TransferSyntax.ImplicitVRLittleEndian);
    }
    in.readValue(in);
    attrs.remove(tag);
    out.writeHeader(Tag.SequenceDelimitationItem, null, 0);
    out.setTransferSyntax(prevTS);
  } else if (!TagUtils.isGroupLengthElement(tag)) {
    out.writeHeader(tag, vr, vallen);
    if (tag == Tag.SpecificCharacterSet
        || TagUtils.isPrivateCreatorDataElement(tag)) {
      byte[] val = in.readBytes(vallen);
      boolean bigEndian = in.getTransferSyntax().bigEndian();
      attrs.putBytes(tag, vr, val, bigEndian);
      out.write(val);
    } else {
      transcodeValue(in, vr);
    }
  }
 }
org.dcm4che2.ioDicomOutputStreamwrite

Javadoc

Write a DICOM dataset to the output stream.

Popular methods of DicomOutputStream

  • <init>
  • writeDataset
    Write a DICOM dataset to the output stream.
  • finish
    Finishes writing compressed data to the output stream without closing the underlying stream. Use thi
  • getTransferSyntax
  • setTransferSyntax
  • writeDicomFile
    Write a DICOM object to the output stream using the specifiedDicomObject to obtain the transfer synt
  • writeHeader
  • close
  • createItemInfo
  • flush
  • getStreamPosition
  • isExplicitItemLength
  • getStreamPosition,
  • isExplicitItemLength,
  • isExplicitItemLengthIfZero,
  • isExplicitSequenceLength,
  • isExplicitSequenceLengthIfZero,
  • isIncludeGroupLength,
  • needItemInfo,
  • serializeDicomObject,
  • setAutoFinish

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now