code: def get_sorted_series_files(self, startpath="", series_number=None, return_files_with_info=False,
                                  sort_keys="SliceLocation", return_files=True, remove_doubled_slice_locations=True):
          dcmdir = self.files_with_info[:]
          if series_number is not None:
              dcmdir = [
                  line for line in dcmdir if line['SeriesNumber'] == series_number
              ]
          dcmdir = sort_list_of_dicts(dcmdir, keys=sort_keys)
          logger.debug('SeriesNumber: ' + str(series_number))
          if remove_doubled_slice_locations:
              dcmdir = self._remove_doubled_slice_locations(dcmdir)
          filelist = []
          for onefile in dcmdir:
              filelist.append(os.path.join(startpath,
                                           self.dirpath, onefile['filename']))
          retval = []
          if return_files:
              retval.append(filelist)
          if return_files_with_info:
              retval.append(dcmdir)
          if len(retval) == 0:
              retval = None
          elif len(retval) == 1:
              retval = retval[0]
          else:
              retval = tuple(retval)
          return retval