def value
      if @value.is_a?(String)
        # Unless this is actually the Character Set data element,
        # get the character set (note that it may not be available):
        character_set = (@tag != '0008,0005' && top_parent.is_a?(DObject)) ? top_parent.value('0008,0005') : nil
        # Convert to UTF-8 from [original encoding]:
        # In most cases the original encoding is IS0-8859-1 (ISO_IR 100), but if
        # it is not specified in the DICOM object, or if the specified string
        # is not recognized, ASCII-8BIT is assumed.
        @value.encode('UTF-8', ENCODING_NAME[character_set])
        # If unpleasant encoding exceptions occur, the below version may be considered:
        #@value.encode('UTF-8', ENCODING_NAME[character_set], :invalid => :replace, :undef => :replace)
      else
        @value
      end
    end
def value
      if @value.is_a?(String)
        # Unless this is actually the Character Set data element,
        # get the character set (note that it may not be available):
        character_set = (@tag != '0008,0005' && top_parent.is_a?(DObject)) ? top_parent.value('0008,0005') : nil
        # Convert to UTF-8 from [original encoding]:
        # In most cases the original encoding is IS0-8859-1 (ISO_IR 100), but if
        # it is not specified in the DICOM object, or if the specified string
        # is not recognized, ASCII-8BIT is assumed.
        @value.encode('UTF-8', ENCODING_NAME[character_set])
        # If unpleasant encoding exceptions occur, the below version may be considered:
        #@value.encode('UTF-8', ENCODING_NAME[character_set], :invalid => :replace, :undef => :replace)
      else
        @value
      end
    end
Gives the (decoded) value of the data element.

 @note Returned string values are automatically converted from their originally
   encoding (e.g. ISO8859-1 or ASCII-8BIT) to UTF-8 for convenience reasons.
   If the value string is wanted in its original encoding, extract the data
   element's bin attribute instead.

 @note Note that according to the DICOM Standard PS 3.5 C.12.1.1.2, the Character Set only applies
 to values of data elements of type SH, LO, ST, PN, LT or UT. Currently in ruby-dicom, all
 string values are encoding converted regardless of VR, but whether this causes any problems is uknown.

 @return [String, Integer, Float] the formatted element value