def remove_dcm2nii_underprocessed(filepaths):
cln_flist = []<EOL>len_sorted = sorted(filepaths, key=len)<EOL>for idx, fpath in enumerate(len_sorted):<EOL><INDENT>remove = False<EOL>fname = op.basename(fpath)<EOL>rest  = len_sorted[idx+<NUM_LIT:1>:]<EOL>for rest_fpath in rest:<EOL><INDENT>rest_file = op.basename(rest_fpath)<EOL>if rest_file.endswith(fname):<EOL><INDENT>remove = True<EOL>break<EOL><DEDENT><DEDENT>if not remove:<EOL><INDENT>cln_flist.append(fpath)<EOL><DEDENT><DEDENT>return cln_flist<EOL>
Return a subset of `filepaths`. Keep only the files that have a basename longer than the
    others with same suffix.
    This works based on that dcm2nii appends a preffix character for each processing
    step it does automatically in the DICOM to NifTI conversion.

    Parameters
    ----------
    filepaths: iterable of str

    Returns
    -------
    cleaned_paths: iterable of str