public class Offsets
extends java.lang.Object
Constructor and Description |
---|
Offsets(DicomObject dcm) |
Modifier and Type | Method and Description |
---|---|
long |
calculateOffset_ge(DicomObject d,
int g,
int e,
int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
Calculate an offset using (group, element) - pair in stead of DDict name.
|
long |
calculateOffset_ge(int g,
int e,
int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
This method calculates the offset of a data element, starting from the very first
byte of the Dicom file.
|
long |
calculateOffset(int dct,
int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
This method calculates the offset of a certain data element 'dct'.
|
long |
calculateOffset(int seq,
int i,
int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
This method calculates and returns the offset of an item in a sequence
|
long |
calculateOffset(int seq,
int i,
int dct,
int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
This method calculates and returns the offset of a data element which is containded
in an item of a sequence
|
long |
calculateSize(boolean groupLengths,
int transferSyntax,
boolean seqUndefined)
Calculates the size of the dicom object using the write options specified.
|
void |
updateSequenceItemOffsets(int ts,
boolean seq_undef,
boolean grouplens,
boolean file)
updates the offset property of all sequence items that are one level deep
to what would be the current offset from the beginning of the stream if
the DicomObject would be written with its current contents.
|
protected JdtLogger log
public Offsets(DicomObject dcm)
public void updateSequenceItemOffsets(int ts, boolean seq_undef, boolean grouplens, boolean file)
public long calculateSize(boolean groupLengths, int transferSyntax, boolean seqUndefined)
groupLengths
- indicates if grouplengths should be added to the sizetransferSyntax
- transfer syntax that has to be used to calculate the sizeseqUndefined
- indicates how sequence items will be encodedpublic long calculateOffset_ge(DicomObject d, int g, int e, int ts, boolean seq_undef, boolean grouplens, boolean file)
public long calculateOffset_ge(int g, int e, int ts, boolean seq_undef, boolean grouplens, boolean file)
g
- the group of the data elemente
- the element of the data elementts
- the transfer syntax that will be used for writing this DicomObjectseq_undef
- what kind of sequence encoding will be used when writing this DicomObjectgrouplens
- boolean indicating whether grouplengths will be writtenfile
- will the DicomObject be written as a file or a stream ?public long calculateOffset(int dct, int ts, boolean seq_undef, boolean grouplens, boolean file)
calculateOffset_ge(g, e, ts, seq_undef, grouplens, file)
dct
- the name of the data elementpublic long calculateOffset(int seq, int i, int ts, boolean seq_undef, boolean grouplens, boolean file)
seq
- name of the sequencei
- number of the item (numbering starts with 0)public long calculateOffset(int seq, int i, int dct, int ts, boolean seq_undef, boolean grouplens, boolean file)
seq
- name of the sequencei
- number of the item (numbering starts with 0)dct
- name of the data element