def write_basic_header
      HEADER_SIGNATURE.each do |header_item|
        begin
          name, length, type = *header_item
          str = @stream.encode(@obj.header[name], type)
          padded_str = @stream.encode_string_to_length(str, length)
          # puts @stream.index, name, str.unpack(@stream.vr_to_str(type))
          # pp padded_str.unpack(@stream.vr_to_str(type))

          @stream.write padded_str
          @stream.skip length
        rescue StandardError => e
          puts name, length, type, e
          raise e
        end
      end
    end
def write_basic_header
      HEADER_SIGNATURE.each do |header_item|
        begin
          name, length, type = *header_item
          str = @stream.encode(@obj.header[name], type)
          padded_str = @stream.encode_string_to_length(str, length)
          # puts @stream.index, name, str.unpack(@stream.vr_to_str(type))
          # pp padded_str.unpack(@stream.vr_to_str(type))

          @stream.write padded_str
          @stream.skip length
        rescue StandardError => e
          puts name, length, type, e
          raise e
        end
      end
    end
Write Basic Header