Trispark JDT
2.50.13

com.archimed.dicom
Class DicomWriter

java.lang.Object
  extended by com.archimed.dicom.DicomWriter

public class DicomWriter
extends java.lang.Object

DicomWriter is capable of writing DicomObject instances to an Outputstream either as DICOM Part 10 files or as raw datasets.

Since:
1.6

Field Summary
static int DCMFILE_GENERATE
           
static int DCMFILE_NO
           
static int DCMFILE_YES
           
static int GRPLEN_ALL
           
static int GRPLEN_KEEP
           
static int GRPLEN_NONE
           
protected  JdtLogger log
           
static int SEQLEN_DEFINED
           
static int SEQLEN_KEEPANDDEF
           
static int SEQLEN_KEEPANDUNDEF
           
static int SEQLEN_UNDEFINED
           
 
Constructor Summary
DicomWriter()
           
 
Method Summary
 void addTagWriteListener(TagWriteListener listener)
          adds a TagReadListener for every data element read
 void addTagWriteListener(TagWriteListener listener, int tag)
          adds a TagWriteListener for a specific data element specified by a tag constant.
 void addTagWriteListener(TagWriteListener listener, int group, int element)
          adds a TagReadListener for a specific data element specified by a group element pair
 void removeTagWriteListener(TagWriteListener listener)
          removes a TagReadListener.
 void removeTagWriteListener(TagWriteListener listener, int tag)
          removes a TagWriteListener.
 void removeTagWriteListener(TagWriteListener listener, int group, int element)
          removes a TagReadListener.
 void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile)
          writes a DicomObject to an OutputStream as a DICOM file or a raw DICOM dataset.
 void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef)
          writes a DicomObject to an OutputStream as a DICOM file or DICOM stream.
 void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef, boolean grouplens)
          writes a DicomObject to an OutputStream as a DICOM file or DICOM stream.
 void writeDataSet(DicomObject dcm, java.io.OutputStream out, int transferSyntax, int seqLengthOpt, int groupLengthOpt)
           
 void writeFile(DicomObject dcm, java.io.OutputStream out, int seqLengthOpt, int groupLengthOpt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRPLEN_NONE

public static final int GRPLEN_NONE
See Also:
Constant Field Values

GRPLEN_ALL

public static final int GRPLEN_ALL
See Also:
Constant Field Values

GRPLEN_KEEP

public static final int GRPLEN_KEEP
See Also:
Constant Field Values

DCMFILE_NO

public static final int DCMFILE_NO
See Also:
Constant Field Values

DCMFILE_YES

public static final int DCMFILE_YES
See Also:
Constant Field Values

DCMFILE_GENERATE

public static final int DCMFILE_GENERATE
See Also:
Constant Field Values

SEQLEN_UNDEFINED

public static final int SEQLEN_UNDEFINED
See Also:
Constant Field Values

SEQLEN_DEFINED

public static final int SEQLEN_DEFINED
See Also:
Constant Field Values

SEQLEN_KEEPANDUNDEF

public static final int SEQLEN_KEEPANDUNDEF
See Also:
Constant Field Values

SEQLEN_KEEPANDDEF

public static final int SEQLEN_KEEPANDDEF
See Also:
Constant Field Values

log

protected JdtLogger log
Constructor Detail

DicomWriter

public DicomWriter()
Method Detail

addTagWriteListener

public void addTagWriteListener(TagWriteListener listener,
                                int tag)
adds a TagWriteListener for a specific data element specified by a tag constant.

Parameters:
listener - TagWriteListener
tag - int

addTagWriteListener

public void addTagWriteListener(TagWriteListener listener,
                                int group,
                                int element)
adds a TagReadListener for a specific data element specified by a group element pair

Parameters:
listener -
group -
element -

addTagWriteListener

public void addTagWriteListener(TagWriteListener listener)
adds a TagReadListener for every data element read

Parameters:
listener - TagReadListener

removeTagWriteListener

public void removeTagWriteListener(TagWriteListener listener,
                                   int tag)
removes a TagWriteListener.

Parameters:
listener -
tag -

removeTagWriteListener

public void removeTagWriteListener(TagWriteListener listener,
                                   int group,
                                   int element)
removes a TagReadListener.

Parameters:
listener -
group -
element -

removeTagWriteListener

public void removeTagWriteListener(TagWriteListener listener)
removes a TagReadListener.

Parameters:
listener - TagReadListener

write

public void write(DicomObject dcm,
                  java.io.OutputStream out,
                  boolean dicomfile)
           throws DicomException,
                  java.io.IOException
writes a DicomObject to an OutputStream as a DICOM file or a raw DICOM dataset. If the DicomObject contains a FileMetaInformation object, the transfersyntax in the filemetainformation object is used. Otherwise the transfer syntax ImplicitVRLittleEndian is used .Files are default written with group lengths and undefined length sequences. (see also Jdt.setWriteDefaultUndefLenSequences(boolean) and Jdt.setWriteDefaultGroupLengths(boolean))

Parameters:
dcm - the DicomObject
out - the OutputStream written to
dicomfile - indicates whether the data set should be written as a DICOM file (see Part 3.10)(true) or as a DICOM stream (false)
Throws:
DicomException
java.io.IOException

write

public void write(DicomObject dcm,
                  java.io.OutputStream out,
                  boolean dicomfile,
                  int transfersyntax,
                  boolean seq_undef)
           throws DicomException,
                  java.io.IOException
writes a DicomObject to an OutputStream as a DICOM file or DICOM stream. The user can specify what transfer syntax and what sequence encoding to use.

Parameters:
dcm - the DicomObject
out - the OutputStream written to
dicomfile - indicates whether the data set should be written as a DICOM file (see Part 3.10)(true) or as a DICOM stream (false)
transfersyntax - the transfer syntax to use
seq_undef - true - all sequences and items are encoded using undefined length, false - all sequences and items are encoded using defined length
Throws:
DicomException
java.io.IOException
See Also:
TransferSyntax

write

public void write(DicomObject dcm,
                  java.io.OutputStream out,
                  boolean dicomfile,
                  int transfersyntax,
                  boolean seq_undef,
                  boolean grouplens)
           throws DicomException,
                  java.io.IOException
writes a DicomObject to an OutputStream as a DICOM file or DICOM stream. The user can specify the transfer syntax,sequence encoding and the use of group lengths to use.

Parameters:
dcm - the DicomObject
out - the OutputStream written to
dicomfile - indicates whether the data set should be written as a DICOM file (see Part 3.10)(true) or as a DICOM stream (false)
transfersyntax - the transfer syntax to use
seq_undef - true - all sequences and items are encoded using undefined length, false - all sequences and items are encoded using defined length
grouplens - when true group length attributes are added.
Throws:
DicomException
java.io.IOException
See Also:
TransferSyntax

writeFile

public void writeFile(DicomObject dcm,
                      java.io.OutputStream out,
                      int seqLengthOpt,
                      int groupLengthOpt)
               throws DicomException,
                      java.io.IOException
Parameters:
dcm - DicomObject
out - OutputStream
seqLengthOpt - int
groupLengthOpt - int
Throws:
DicomException
java.io.IOException

writeDataSet

public void writeDataSet(DicomObject dcm,
                         java.io.OutputStream out,
                         int transferSyntax,
                         int seqLengthOpt,
                         int groupLengthOpt)
                  throws DicomException,
                         java.io.IOException
Parameters:
dcm - DicomObject
out - OutputStream
transferSyntax - int
fileOpt - int
seqLengthOpt - int
grouplengthOpt - int
Throws:
DicomException
java.io.IOException

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.