@classmethod
def from_list(cls, list_file, n_files=None, **kwargs):
    """
        Initialize with a .txt list containing the filepaths.

        Parameters
        ----------
        list_file : str
            Path to a txt file containing the input filepaths, one per line.
        n_files : int, optional
            Only load these many files from the list.

        """
    input_files = []
    with open(list_file) as f:
        for line in f:
            filepath = line.rstrip('\n')
            if filepath != '':
                input_files.append(filepath)
    if n_files is not None:
        input_files = input_files[:n_files]
    return cls(input_files, **kwargs)
