Skip to content

Commit

Permalink
Merge pull request #248 from mingujo/min-multi
Browse files Browse the repository at this point in the history
Min multi
  • Loading branch information
mingujo committed Dec 14, 2015
2 parents 86d810f + 9669ba0 commit e3d1ad5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions code/utils/scripts/multi_comparison_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
sys.path.append(os.path.join(os.path.dirname('__file__'), "../functions/"))
import numpy as np
from glm import *
#from convolution_normal_script import X_matrix
#from convolution_high_res_script import X_matrix_high_res
from load_BOLD import *
import nibabel as nib
import matplotlib.pyplot as plt
from scipy.stats import sem
#from scipy.stats import sem
from smoothing import *
from visulation import *
from scipy.stats import t as t_dist
#from visualization import *


dirs = ['../../../txt_output/multi_beta']
Expand Down Expand Up @@ -55,27 +53,28 @@
task_sum +=task[x]

task_mean = task_sum/16
# plot task_mean
#task_mean.shape -> (902629,0)

#calculate variance and plot
stdlst = []
for x in range(1,17):
stdlst.append(task[x])
stdarray = np.array(stdlst)
task_std = stdarray.std(axis=0)
# plot task_std


#will use sem here (standard error across 16 subjects)
#task_std.shape -> (902629,0)
task_std_reshape = task_std.reshape(91,109,91)


#calculate t-stat and plot
task_tstat = task_mean/task_std
#task_tstat -> (902629,0)
task_tstat_reshape = task_tstat.reshape(91,109,91)
#plot task_tstat


#calculate p-value and plot
task_pval = t_dist.cdf(abs(task_tstat), 15)
task_pval_reshape = task_pval.reshape(91,109,91)
1-task_pval
#plot task

Expand All @@ -84,3 +83,4 @@




0 comments on commit e3d1ad5

Please sign in to comment.