def METHOD_NAME(derivatives_dir, output_dir, mod):
    """
    Reads the metadata in the JIQM (json iqm) files and
    generates a corresponding prediction CSV table
    """
    if mod != "T1w":
        return None
    # If some were found, generate the CSV file and group report
    jsonfiles = list(output_dir.glob("sub-*/**/%s/sub-*_%s.json" % (IMTYPES[mod], mod)))
    if not jsonfiles:
        return None
    headers = list(BIDS_COMP.keys()) + ["mriqc_pred"]
    predictions = {k: [] for k in headers}
    for jsonfile in jsonfiles:
        with open(jsonfile, "r") as jsondata:
            data = json.load(jsondata).pop("bids_meta", None)
        if data is None:
            continue
        for k in headers:
            predictions[k].append(data.pop(k, None))
    dataframe = pd.DataFrame(predictions).sort_values(by=list(BIDS_COMP.keys()))
    # Drop empty columns
    dataframe.dropna(axis="columns", how="all", inplace=True)
    bdits_cols = list(set(BIDS_COMP.keys()) & set(dataframe.columns.ravel()))
    # Drop duplicates
    dataframe.drop_duplicates(bdits_cols, keep="last", inplace=True)
    out_csv = Path(output_dir) / ("%s_predicted_qa_csv" % mod)
    dataframe[bdits_cols + ["mriqc_pred"]].to_csv(str(out_csv), index=False)
    return out_csv