public class DicomWriter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
DicomWriter() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final int GRPLEN_NONE
public static final int GRPLEN_ALL
public static final int GRPLEN_KEEP
public static final int SEQLEN_UNDEFINED
public static final int SEQLEN_DEFINED
public static final int SEQLEN_KEEPANDUNDEF
public static final int SEQLEN_KEEPANDDEF
protected JdtLogger log
public void addTagWriteListener(TagWriteListener listener, int tag)
listener - TagWriteListenertag - intpublic void addTagWriteListener(TagWriteListener listener, int group, int element)
listener - the TagWriteListenergroup - group value of the specific data elementelement - element value of the specific data elementpublic void addTagWriteListener(TagWriteListener listener)
listener - TagReadListenerpublic void removeTagWriteListener(TagWriteListener listener, int tag)
listener - the TagWriteListenertag - DDict constantpublic void removeTagWriteListener(TagWriteListener listener, int group, int element)
listener - the TagWriteListenergroup - group value of the data element for which the listener should be removedelement - element value of the data element for which the listener should be removedpublic void removeTagWriteListener(TagWriteListener listener)
listener - TagReadListenerpublic void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile) throws DicomException, java.io.IOException
Jdt.setWriteDefaultUndefLenSequences(boolean)
and Jdt.setWriteDefaultGroupLengths(boolean))dcm - the DicomObjectout - the OutputStream written todicomfile - indicates whether the data set should be written as a
DICOM file (see Part 3.10)(true) or as a DICOM stream (false)DicomException - DicomExceptionjava.io.IOException - IOExceptionpublic void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef) throws DicomException, java.io.IOException
dcm - the DicomObjectout - the OutputStream written todicomfile - 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 useseq_undef - true - all sequences and items are encoded using undefined length,
false - all sequences and items are encoded using defined lengthDicomExceptionjava.io.IOExceptionTransferSyntaxpublic void write(DicomObject dcm, java.io.OutputStream out, boolean dicomfile, int transfersyntax, boolean seq_undef, boolean grouplens) throws DicomException, java.io.IOException
dcm - the DicomObjectout - the OutputStream written todicomfile - 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 useseq_undef - true - all sequences and items are encoded using undefined length,
false - all sequences and items are encoded using defined lengthgrouplens - when true group length attributes are added.DicomExceptionjava.io.IOExceptionTransferSyntaxpublic void writeFile(DicomObject dcm, java.io.OutputStream out, int seqLengthOpt, int groupLengthOpt) throws DicomException, java.io.IOException
dcm - DicomObjectout - OutputStreamseqLengthOpt - int one of the SEQLEN_ constantsgroupLengthOpt - int one of the GRPLEN_ constantsDicomException - DicomExceptionjava.io.IOException - IOExceptionpublic void writeDataSet(DicomObject dcm, java.io.OutputStream out, int transferSyntax, int seqLengthOpt, int groupLengthOpt) throws DicomException, java.io.IOException
dcm - DicomObjectout - OutputStreamtransferSyntax - int TransferSyntax constantsseqLengthOpt - int one of the SEQLEN_ constantsgroupLengthOpt - int one of the GRPLEN_ constantsDicomException - DicomExceptionjava.io.IOException - IOException