jdcm
Class DicomElement

java.lang.Object
  extended by jdcm.DicomElement

public final class DicomElement
extends java.lang.Object

This class encapsulates a DICOM data element. A DICOM Data Element represents a specifically identified piece of information that has an group and element number, a Value Representation (VR) and a Value Multiplicity(VM).

See Also:
DicomSequence

Constructor Summary
DicomElement(int group, int element, java.lang.String vr, byte[] value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a array byte byte[] value.
DicomElement(int group, int element, java.lang.String vr, DicomSequence sequence)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a sequence.
DicomElement(int group, int element, java.lang.String vr, double value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a double value.
DicomElement(int group, int element, java.lang.String vr, double[] value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a multiple double value.
DicomElement(int group, int element, java.lang.String vr, int value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a single int value.
DicomElement(int group, int element, java.lang.String vr, int[] value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a mutiple int values.
DicomElement(int group, int element, java.lang.String vr, java.lang.String value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a String value.
DicomElement(int group, int element, java.lang.String vr, java.lang.String[] value)
          Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a multiple String value.
 
Method Summary
 int getElement()
          Retrieve the element number of the dicom element
 int getGroup()
          Retrieves the group number of the dicom element
 DicomSequence getSequence()
          Retrieve the sequence for SQ OW and OB dicom elements
 byte[] getValue()
          Retrieve the array byte value of the dicom element
 double getValueAsDouble()
          Retrieve the first value of the dicom element as an double.
 double getValueAsDouble(int index)
          Retrieve the index value of the dicom element as an double.
 int getValueAsInt()
          Retrieve the first value of the dicom element as an int.
 int getValueAsInt(int index)
          Retrieve the index value of the dicom element as an int.
 java.lang.String getValueAsString()
          Return value as String
 java.lang.String getValueAsString(int index)
          Retrieve the index value of the dicom element as an String.
 int getVM()
          Retrieve the value multiplicity of the dicom element.
 java.lang.String getVR()
          Retrieves the data element's Value Representation
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    int value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a single int value.

Parameters:
group -
element -
vr - SL,UL,IS,US,SS
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    int[] value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a mutiple int values.

Parameters:
group -
element -
vr - SL,UL,IS,US,SS
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    byte[] value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a array byte byte[] value.

Parameters:
group -
element -
vr - OB,OW,AT
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    java.lang.String value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a String value.

Parameters:
group -
element -
vr - AE,AS,CS,DS,IS,LO,LT,PN,SH,SS,ST,UI,UN,UT,DT,DA,TM,AT
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    java.lang.String[] value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a multiple String value.

Parameters:
group -
element -
vr - AE,AS,CS,DS,IS,LO,LT,PN,SH,SS,ST,UI,UN,UT,DT,DA,TM,AT
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    double value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a double value.

Parameters:
group -
element -
vr - FL,FD,OF
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    double[] value)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a multiple double value.

Parameters:
group -
element -
vr - FL,FD,OF
value -

DicomElement

public DicomElement(int group,
                    int element,
                    java.lang.String vr,
                    DicomSequence sequence)
Constructs a Dicom Element with a group, element numbers, Value Representation (VR) and a sequence.

Parameters:
group -
element -
vr - SQ OB OW
sequence -
Method Detail

getValueAsInt

public int getValueAsInt()
Retrieve the first value of the dicom element as an int.

The getValueAsInt() method for class DicomElement has the same effect as:

 getValueAsInt(0) 

Returns:
Return the value if VR is equals to SL, UL, SS, IS otherwise 0

getValueAsInt

public int getValueAsInt(int index)
Retrieve the index value of the dicom element as an int.

Parameters:
index -
Returns:
Return the value if VR is equals to SL, UL, SS, IS otherwise 0

getValueAsDouble

public double getValueAsDouble()
Retrieve the first value of the dicom element as an double.

The getValueAsDouble() method for class DicomElement has the same effect as:

 getValueAsDouble(0) 

Returns:
Return the value if VR is equals to FL, FD, OF otherwise 0.0

getValueAsDouble

public double getValueAsDouble(int index)
Retrieve the index value of the dicom element as an double.

Parameters:
index -
Returns:
Return the value if VR is equals to FL, FD, OF otherwise 0.0

getValueAsString

public java.lang.String getValueAsString()
Return value as String


getValueAsString

public java.lang.String getValueAsString(int index)
Retrieve the index value of the dicom element as an String.

Parameters:
index -
Returns:
Return the value if VR is equals to AE,AS,CS,DS,IS,LO,LT,PN,SH,SS,ST,UI,UN,UT,DT,DA,TM otherwise "".

getVM

public int getVM()
Retrieve the value multiplicity of the dicom element.


getSequence

public DicomSequence getSequence()
Retrieve the sequence for SQ OW and OB dicom elements

Returns:
return null if sequence is not present.

getValue

public byte[] getValue()
Retrieve the array byte value of the dicom element


getGroup

public int getGroup()
Retrieves the group number of the dicom element


getElement

public int getElement()
Retrieve the element number of the dicom element


getVR

public java.lang.String getVR()
Retrieves the data element's Value Representation


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object