docs: def read_dicom_directory(dicom_directory, stop_before_pixels=False):
      """
      Read all dicom files in a given directory (stop before pixels)
  
      :type stop_before_pixels: bool
      :type dicom_directory: six.string_types
      :param stop_before_pixels: Should we stop reading before the pixeldata (handy if we only want header info)
      :param dicom_directory: Directory with dicom data
      :return: List of dicom objects
      """
      dicom_input = []
      for root, _, files in os.walk(dicom_directory):
          for dicom_file in files:
              file_path = os.path.join(root, dicom_file)
              if compressed_dicom.is_dicom_file(file_path):
                  dicom_headers = compressed_dicom.read_file(file_path,
                                                             defer_size="1 KB",
                                                             stop_before_pixels=stop_before_pixels,
                                                             force=dicom2nifti.settings.pydicom_read_force)
                  if is_valid_imaging_dicom(dicom_headers):
                      dicom_input.append(dicom_headers)
      return dicom_input