def image_from_file(file)
      raise ArgumentError, "Expected #{String}, got #{file.class}." unless file.is_a?(String)
      f = File.new(file, 'rb')
      bin = f.read(f.stat.size)
      if bin.length > 0
        # Write the binary data to the Pixel Data Element:
        write_pixels(bin)
      else
        logger.info("The specified file (#{file}) is empty. Nothing to transfer.")
      end
    end
def image_from_file(file)
      raise ArgumentError, "Expected #{String}, got #{file.class}." unless file.is_a?(String)
      f = File.new(file, 'rb')
      bin = f.read(f.stat.size)
      if bin.length > 0
        # Write the binary data to the Pixel Data Element:
        write_pixels(bin)
      else
        logger.info("The specified file (#{file}) is empty. Nothing to transfer.")
      end
    end
Reads a binary string from a specified file and writes it to the value field of the pixel data element (7FE0,0010).

 @param [String] file a string which specifies the path of the file containing pixel data

 @example Load pixel data from a file
   dcm.image_from_file("custom_image.dat")