Skip to content

config.json missing information #59

Description

@jimzhang629

Several functions in utils.organize.py and data2bids.py use a "type" variable from the config.json, but the config.json does not have this.

For example, the below function from organize.py calls ieeg_config["type"] but this doesn't exist.

def prep_tsv(file_path: PathLike, task: str, pmatchz: str, ieeg_config: dict,
             bids_dir: PathLike) -> (str, pd.DataFrame):
    df = None
    for name, var in ieeg_config["headerData"]["channels"].items():
        if name in file_path:
            df = mat2df(file_path, var)
            if "highpass_cutoff" in df.columns.to_list():
                df = df.rename(columns={"highpass_cutoff": "high_cutoff"})
            if "lowpass_cutoff" in df.columns.to_list():
                df = df.rename(columns={"lowpass_cutoff": "low_cutoff"})
    df["type"] = ieeg_config["type"] #uhhhh wtf is this???
    df["units"] = ieeg_config["headerData"]["units"]
    new_row = pd.DataFrame(
        {"name": ["Trigger"], "high_cutoff": [1], "low_cutoff": [1000],
         "type": ["TRIG"], "units": ["uV"]})
    df = pd.concat([df, new_row], ignore_index=True)
    df = pd.concat([df["name"], df["type"], df["units"], df["low_cutoff"],
                    df["high_cutoff"]], axis=1)
    filename = op.join(bids_dir, "sub-{}".format(pmatchz),
                       "sub-" + pmatchz + "_task-{}".format(
                           task) + "_channels.tsv")
    return filename, df

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions