4a81e9b234ae65c2f146061cb3244b49cb10f106,pynets/fmri/clustools.py,,nil_parcellate,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,375

Before Change


                print("Warning: NaN\"s detected in confound regressor file. Filling these with mean values, but the "
                      "regressor file should be checked manually.")
                confounds_nonan = confounds.apply(lambda x: x.fillna(x.mean()), axis=0)
                conf_corr = "/tmp/confounds_mean_corrected_" + str(run_uuid) + ".tsv"
                confounds_nonan.to_csv(conf_corr, sep="\t")
                clust_est.fit(func_img, confounds=conf_corr)
            else:
                clust_est.fit(func_img, confounds=conf)

After Change


                print("Warning: NaN\"s detected in confound regressor file. Filling these with mean values, but the "
                      "regressor file should be checked manually.")
                confounds_nonan = confounds.apply(lambda x: x.fillna(x.mean()), axis=0)
                os.makedirs("%s%s" % (dir_path, "/confounds_tmp"), exist_ok=True)
                conf_corr = "%s%s%s%s" % (dir_path, "/confounds_tmp/confounds_mean_corrected_", run_uuid, ".tsv")
                confounds_nonan.to_csv(conf_corr, sep="\t")
                clust_est.fit(func_img, confounds=conf_corr)
            else:
                clust_est.fit(func_img, confounds=conf)
        else:
            clust_est.fit(func_img)
        region_labels = connected_label_regions(clust_est.labels_img_)
        nib.save(region_labels, uatlas)
    else:
        clust_est = Parcellations(method=clust_type, standardize=standardize, detrend=detrending, n_parcels=int(k),
                                  mask=clust_mask)
        if conf is not None:
            import pandas as pd
            confounds = pd.read_csv(conf, sep="\t")
            if confounds.isnull().values.any():
                import uuid
                from time import strftime
                run_uuid = "%s_%s" % (strftime("%Y%m%d-%H%M%S"), uuid.uuid4())
                print("Warning: NaN\"s detected in confound regressor file. Filling these with mean values, but the "
                      "regressor file should be checked manually.")
                confounds_nonan = confounds.apply(lambda x: x.fillna(x.mean()), axis=0)
                os.makedirs("%s%s" % (dir_path, "/confounds_tmp"), exist_ok=True)
                conf_corr = "%s%s%s%s" % (dir_path, "/confounds_tmp/confounds_mean_corrected_", run_uuid, ".tsv")
                confounds_nonan.to_csv(conf_corr, sep="\t")
                clust_est.fit(func_img, confounds=conf_corr)
            else:
                clust_est.fit(func_img, confounds=conf)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: dPys/PyNets
Commit Name: 4a81e9b234ae65c2f146061cb3244b49cb10f106
Time: 2019-10-11
Author: dpisner@utexas.edu
File Name: pynets/fmri/clustools.py
Class Name:
Method Name: nil_parcellate


Project Name: dPys/PyNets
Commit Name: 4a81e9b234ae65c2f146061cb3244b49cb10f106
Time: 2019-10-11
Author: dpisner@utexas.edu
File Name: pynets/fmri/clustools.py
Class Name:
Method Name: nil_parcellate


Project Name: dPys/PyNets
Commit Name: 4a81e9b234ae65c2f146061cb3244b49cb10f106
Time: 2019-10-11
Author: dpisner@utexas.edu
File Name: pynets/fmri/estimation.py
Class Name:
Method Name: extract_ts_parc


Project Name: dPys/PyNets
Commit Name: 4a81e9b234ae65c2f146061cb3244b49cb10f106
Time: 2019-10-11
Author: dpisner@utexas.edu
File Name: pynets/fmri/estimation.py
Class Name:
Method Name: extract_ts_coords