def print(options={})
      # FIXME: Perhaps a :children => false option would be a good idea (to avoid lengthy printouts in cases where this would be desirable)?
      # FIXME: Speed. The new print algorithm may seem to be slower than the old one (observed on complex, hiearchical DICOM files). Perhaps it can be optimized?
      elements = Array.new
      # We first gather some properties that is necessary to produce a nicely formatted printout (max_lengths, count_all),
      # then the actual information is gathered (handle_print),
      # and lastly, we pass this information on to the methods which print the output (print_file or print_screen).
      if count > 0
        max_name, max_length, max_generations = max_lengths
        max_digits = count_all.to_s.length
        visualization = Array.new
        elements, index = handle_print(start_index=1, max_digits, max_name, max_length, max_generations, visualization, options)
        if options[:file]
          print_file(elements, options[:file])
        else
          print_screen(elements)
        end
      else
        puts "Notice: Object #{self} is empty (contains no data elements)!"
      end
      return elements
    end
def print(options={})
      # FIXME: Perhaps a :children => false option would be a good idea (to avoid lengthy printouts in cases where this would be desirable)?
      # FIXME: Speed. The new print algorithm may seem to be slower than the old one (observed on complex, hiearchical DICOM files). Perhaps it can be optimized?
      elements = Array.new
      # We first gather some properties that is necessary to produce a nicely formatted printout (max_lengths, count_all),
      # then the actual information is gathered (handle_print),
      # and lastly, we pass this information on to the methods which print the output (print_file or print_screen).
      if count > 0
        max_name, max_length, max_generations = max_lengths
        max_digits = count_all.to_s.length
        visualization = Array.new
        elements, index = handle_print(start_index=1, max_digits, max_name, max_length, max_generations, visualization, options)
        if options[:file]
          print_file(elements, options[:file])
        else
          print_screen(elements)
        end
      else
        puts "Notice: Object #{self} is empty (contains no data elements)!"
      end
      return elements
    end
Prints all child elementals of this particular parent.
 Information such as tag, parent-child relationship, name, vr, length and value is
 gathered for each element and processed to produce a nicely formatted output.

 @param [Hash] options the options to use for handling the printout
 option options [Integer] :value_max if a value max length is specified, the element values which exceeds this are trimmed
 option options [String] :file if a file path is specified, the output is printed to this file instead of being printed to the screen
 @return [Array<String>] an array of formatted element string lines
 @example Print a DObject instance to screen
   dcm.print
 @example Print the DObject to the screen, but specify a 25 character value cutoff to produce better-looking results
   dcm.print(:value_max => 25)
 @example Print to a text file the elements that belong to a specific Sequence
   dcm["3006,0020"].print(:file => "dicom.txt")