Example #1
0
def run_qc_temporal(func_path, mask_path, 
                    motion_matrix_path, 
                    subject=None, session=None, scan=None, 
                    verbose=False):
    # DVARS
    if verbose: print "...dvars"
    mean_dvars  = mean_dvars_wrapper(func_path, mask_path)
    
    # Mean FD (Jenkinson)
    if verbose: print "...mean FD"
    mean_fd     = mean_fd_wrapper(motion_matrix)
    
    # 3dTout
    if verbose: print "...3dTout"
    mean_outlier= mean_outlier_timepoints(func_path, mask_path)
    
    # 3dTqual
    if verbose: print "...3dTqual"
    mean_quality= mean_quality_timepoints(func_path)
    
    # Compile
    qc = {
        "subject":  subject, 
        "session":  session, 
        "scan":     scan, 
        "dvars":    mean_dvars, 
        "fd":       mean_fd, 
        "outlier":  mean_outlier, 
        "quality":  mean_quality
    }
    
    return qc
Example #2
0
File: qc.py Project: roijo/abide-2
def run_qc_temporal(func_path, mask_path, 
                    motion_matrix_path, 
                    subject=None, session=None, scan=None, 
                    verbose=False, motion_threshold=1.0, 
                    opts=["dvars", "fd", "outlier", "quality"]):
    # DVARS
    if "dvars" in opts:
        if verbose: print "...dvars"
        mean_dvars  = mean_dvars_wrapper(func_path, mask_path)
    else:
        mean_dvars  = None
    
    # Mean FD (Jenkinson)
    if "fd" in opts:
        if verbose: print "...mean FD"
        (mean_fd, num_fd, percent_fd) = summarize_fd(motion_matrix_path, threshold=motion_threshold)
    else:
        (mean_fd, num_fd, percent_fd) = (None, None, None)
    
    # 3dTout
    if "outlier" in opts:
        if verbose: print "...3dTout"
        mean_outlier= mean_outlier_timepoints(func_path, mask_path)
    else:
        mean_outlier= None
    
    # 3dTqual
    if "quality" in opts:
        if verbose: print "...3dTqual"
        mean_quality= mean_quality_timepoints(func_path)
    else:
        mean_quality= None
    
    # Compile
    qc = {
        "subject":  subject, 
        "session":  session, 
        "scan":     scan, 
        "dvars":    mean_dvars, 
        "mean_fd":  mean_fd, 
        'num_fd':   num_fd, 
        'perc_fd':  percent_fd, 
        "outlier":  mean_outlier, 
        "quality":  mean_quality
    }
    
    return qc